diff options
author | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2017-10-27 10:53:51 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2018-05-04 10:56:35 +0000 |
commit | 1e9da7b3fd06dd3edd642d0f6479199b5174c928 (patch) | |
tree | 27e45a0ad41bd97a4bc68916afffbc9aa6d4a89e /tests/auto/other/qaccessibility/tst_qaccessibility.cpp | |
parent | 10b3286313c78fa380b5fe676a7c14f3ae84f017 (diff) |
Accessibility: Fix leaking cached interfaces
When the application closes, we should clear the cache to not run into
memory sanitizers claiming that we leak.
Change-Id: Ibf9fcda107be6b7f3ed414d7651080aa1f61a3a5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'tests/auto/other/qaccessibility/tst_qaccessibility.cpp')
-rw-r--r-- | tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index b5d45adadb..a593deb90e 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -876,6 +876,10 @@ void tst_QAccessibility::applicationTest() QCOMPARE(interface->child(1), static_cast<QAccessibleInterface*>(0)); QCOMPARE(interface->childCount(), 0); + // Check that asking for the application interface twice returns the same object + QAccessibleInterface *app2 = QAccessible::queryAccessibleInterface(qApp); + QCOMPARE(interface, app2); + QWidget widget; widget.show(); qApp->setActiveWindow(&widget); |