Fix memory leak in test
authorFrederik Gladhorn <frederik.gladhorn@digia.com>
Mon, 10 Feb 2014 09:59:17 +0000 (10:59 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 10 Feb 2014 23:24:08 +0000 (00:24 +0100)
Change-Id: I026ce85a6e593d5eccecdf032ee2f0763a2bef87
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp

index 0ff378e..4bf5687 100644 (file)
@@ -378,11 +378,11 @@ void tst_QQuickAccessible::hitTest()
 
 void tst_QQuickAccessible::checkableTest()
 {
-    QQuickView *window = new QQuickView();
+    QScopedPointer<QQuickView> window(new QQuickView());
     window->setSource(testFileUrl("checkbuttons.qml"));
     window->show();
 
-    QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(window);
+    QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(window.data());
     QVERIFY(iface);
     QAccessibleInterface *root = iface->child(0);