diff options
author | Jan Arve Saether <jan-arve.saether@qt.io> | 2017-01-19 16:10:09 +0100 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@qt.io> | 2017-01-23 09:02:58 +0000 |
commit | c4067b42f7ab359ed8d1285211a3eb2311ed5338 (patch) | |
tree | d2b47f4dc5ab40fc08b85f7a0aaee1e13c7b353a /tests | |
parent | 63ce81bb052a5c462cf30f2e4293466fb9084f5a (diff) |
Do not leak the item, and use a QScopedPointer to guarantee cleanup
Change-Id: Ib4160f418686cef6d85dfd64657d25836f66778e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/qquickloader/tst_qquickloader.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/auto/quick/qquickloader/tst_qquickloader.cpp b/tests/auto/quick/qquickloader/tst_qquickloader.cpp index 77af4796b6..3e7439f3e9 100644 --- a/tests/auto/quick/qquickloader/tst_qquickloader.cpp +++ b/tests/auto/quick/qquickloader/tst_qquickloader.cpp @@ -469,7 +469,7 @@ void tst_QQuickLoader::networkComponent() // because in the synchronous case we're already done loading. QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QQuickItem *item = qobject_cast<QQuickItem*>(component.create()); + QScopedPointer<QQuickItem> item(qobject_cast<QQuickItem*>(component.create())); QVERIFY(item); QQuickLoader *loader = qobject_cast<QQuickLoader*>(item->children().at(1)); @@ -481,7 +481,6 @@ void tst_QQuickLoader::networkComponent() QCOMPARE(loader->status(), QQuickLoader::Ready); QCOMPARE(static_cast<QQuickItem*>(loader)->children().count(), 1); - delete loader; } void tst_QQuickLoader::failNetworkRequest() |