summaryrefslogtreecommitdiffstats
path: root/src/widgets/doc/snippets/qtablewidget-using/main.cpp
diff options
context:
space:
mode:
authorEven Oscar Andersen <even.oscar.andersen@qt.io>2025-08-04 10:23:19 +0200
committerEven Oscar Andersen <even.oscar.andersen@qt.io>2025-08-04 17:53:47 +0200
commit8e0754c682faca09365ad728050a0195dd78e016 (patch)
treea4a086757836f5ea54f7eb5f513629259f1d03be /src/widgets/doc/snippets/qtablewidget-using/main.cpp
parent5f0e6482b67372f1ef7b5a3806e011265bb9a1de (diff)
Fix crash when sending ObjectDestroyed events without an a11y interface
The a11y test library copies events, there is a case where we send ObjectDestroyed on an object, as opposed to the expected a11y interface. When this happens, the program will crash on a null pointer read. The fix is to support these two scenarios: 1) (object == nullptr, m_uniqueId set) 2) (object != nullptr, m_childId set) For the first case, we no longer have access to the object, so event->object() will be nullptr. This is a change, and happens when the event is sent from the various destructors. For the second case, which happens when the object is still alive, we set m_object, and QAccessibleEvent::accessibleInterface will do the correct thing and return the interface, this is also a change, earlier we would try to access m_uniqueId which was aliased by childId(-1). Fixes: QTBUG-138824 Pick-to: 6.10 Change-Id: If8e4f8d0e26c3c5793f876b1c25b0653621af1e9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/doc/snippets/qtablewidget-using/main.cpp')
0 files changed, 0 insertions, 0 deletions