Do not leak the item, and use a QScopedPointer to guarantee cleanup
Change-Id: Ib4160f418686cef6d85dfd64657d25836f66778e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
parent
63ce81bb05
commit
c4067b42f7
|
@ -469,7 +469,7 @@ void tst_QQuickLoader::networkComponent()
|
||||||
// because in the synchronous case we're already done loading.
|
// because in the synchronous case we're already done loading.
|
||||||
QTRY_COMPARE(component.status(), QQmlComponent::Ready);
|
QTRY_COMPARE(component.status(), QQmlComponent::Ready);
|
||||||
|
|
||||||
QQuickItem *item = qobject_cast<QQuickItem*>(component.create());
|
QScopedPointer<QQuickItem> item(qobject_cast<QQuickItem*>(component.create()));
|
||||||
QVERIFY(item);
|
QVERIFY(item);
|
||||||
|
|
||||||
QQuickLoader *loader = qobject_cast<QQuickLoader*>(item->children().at(1));
|
QQuickLoader *loader = qobject_cast<QQuickLoader*>(item->children().at(1));
|
||||||
|
@ -481,7 +481,6 @@ void tst_QQuickLoader::networkComponent()
|
||||||
QCOMPARE(loader->status(), QQuickLoader::Ready);
|
QCOMPARE(loader->status(), QQuickLoader::Ready);
|
||||||
QCOMPARE(static_cast<QQuickItem*>(loader)->children().count(), 1);
|
QCOMPARE(static_cast<QQuickItem*>(loader)->children().count(), 1);
|
||||||
|
|
||||||
delete loader;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QQuickLoader::failNetworkRequest()
|
void tst_QQuickLoader::failNetworkRequest()
|
||||||
|
|
Loading…
Reference in New Issue