Accessibility: Fix crash with invalid QAccessibleInterface

Windows accessibility can crash if it handles an event with an invalid
QAccessibleInterface pointer (one whose object has been deleted).

Task-number: QTBUG-41597
Change-Id: Iba099f7cb732fd00f18f04bd951c6cdd94785871
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
This commit is contained in:
Dyami Caliri 2014-09-25 10:37:34 -07:00 committed by Friedemann Kleint
parent 27bc4c4ce5
commit 138e14d7bb

View File

@ -159,7 +159,7 @@ void QWindowsAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
// An event has to be associated with a window,
// so find the first parent that is a widget and that has a WId
QAccessibleInterface *iface = event->accessibleInterface();
if (!iface) // ### This should not happen, maybe make it an assert.
if (!iface || !iface->isValid())
return;
QWindow *window = QWindowsAccessibility::windowHelper(iface);