From 138e14d7bb749c08c751ca107393ce8b29c692d9 Mon Sep 17 00:00:00 2001 From: Dyami Caliri Date: Thu, 25 Sep 2014 10:37:34 -0700 Subject: Accessibility: Fix crash with invalid QAccessibleInterface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jan Arve Sæther --- src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/windows') diff --git a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp index 307f2fc3bb..139e1dbecd 100644 --- a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp +++ b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp @@ -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); -- cgit v1.2.3