From fe52d1853ed48d7092c6835b1ce14eb7f21fe7f5 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 21 Mar 2013 22:56:23 +0100 Subject: Accessibility: Fix crash in windowHelper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When accessing the parent, we cannot be sure that the parent interfaces are all valid. Invalid parents can happen during destruction. Another cause is unusual hierarchies, the QAbstractItemView::columnDelegate test triggers a situation where this used to crash. In addition to the actual problem, add checks for every parent() call. Change-Id: I70b2bf7bc3c02b0f33e22b81023fd24519adeba9 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/accessible/qwindowsaccessibility.cpp') diff --git a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp index 146b114389..79d0934ebb 100644 --- a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp +++ b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp @@ -215,7 +215,7 @@ QWindow *QWindowsAccessibility::windowHelper(const QAccessibleInterface *iface) QWindow *window = iface->window(); if (!window) { QAccessibleInterface *acc = iface->parent(); - while (acc && !window) { + while (acc && acc->isValid() && !window) { window = acc->window(); QAccessibleInterface *par = acc->parent(); delete acc; -- cgit v1.2.3