summaryrefslogtreecommitdiffstats
path: root/tests/auto/qaccessibility
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2012-12-11 11:39:08 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-16 01:51:22 +0100
commitbe330d8959dbd1a589a9d46e4ed12b5b16fffbb4 (patch)
tree54aa02e264a6141b74e93b4c94357b77c5ec4b03 /tests/auto/qaccessibility
parent91e8baa37baea4a79641c1eb0512d609745a033b (diff)
a11y: Do not refer to destructed QObject in Windows bridge
The crash could happen if a QWidget in the UI got deleted, and the AT client later tried to access the widget through the cache (qAccessibleRecentSentEvents()). Solution: Use a QPointer as a guard. Task-number: QTBUG-26187 Change-Id: I41eab158989fddfa147309b6bd91ac0cd1fe7b1a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'tests/auto/qaccessibility')
-rw-r--r--tests/auto/qaccessibility/tst_qaccessibility.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp
index d47eb060aa..39207ec6b0 100644
--- a/tests/auto/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp
@@ -436,7 +436,15 @@ void tst_QAccessibility::eventTest()
button->hide();
QVERIFY_EVENT(button, 0, QAccessible::ObjectHide);
+ // Destroy a visible widget
+ QTestAccessibility::clearEvents();
+ button->show();
+ QVERIFY_EVENT(button, 0, QAccessible::ObjectShow);
+
delete button;
+
+ QVERIFY_EVENT(button, 0, QAccessible::ObjectHide);
+ QVERIFY_EVENT(button, 0, QAccessible::ObjectDestroyed);
}
void tst_QAccessibility::customWidget()