summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2012-12-11 10:39:08 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-16 00:51:22 (GMT)
commitbe330d8959dbd1a589a9d46e4ed12b5b16fffbb4 (patch)
tree54aa02e264a6141b74e93b4c94357b77c5ec4b03 /tests/auto
parent91e8baa37baea4a79641c1eb0512d609745a033b (diff)
downloadQt-be330d8959dbd1a589a9d46e4ed12b5b16fffbb4.zip
Qt-be330d8959dbd1a589a9d46e4ed12b5b16fffbb4.tar.gz
Qt-be330d8959dbd1a589a9d46e4ed12b5b16fffbb4.tar.bz2
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')
-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 d47eb06..39207ec 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()