From 1e9da7b3fd06dd3edd642d0f6479199b5174c928 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 27 Oct 2017 10:53:51 +0200 Subject: Accessibility: Fix leaking cached interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jan Arve Sæther --- tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/auto/other/qaccessibility') 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(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); -- cgit v1.2.3