tst_qqmlmetatype.cpp: Avoid memory leaks
Change-Id: Ic4ff36e48a1ff5146ec44f58ed416fd24cce5330 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
6567ac4362
commit
c6e63aa128
|
@ -307,7 +307,7 @@ void tst_qqmlmetatype::compositeType()
|
||||||
|
|
||||||
//Loading the test file also loads all composite types it imports
|
//Loading the test file also loads all composite types it imports
|
||||||
QQmlComponent c(&engine, testFileUrl("testImplicitComposite.qml"));
|
QQmlComponent c(&engine, testFileUrl("testImplicitComposite.qml"));
|
||||||
QObject* obj = c.create();
|
QScopedPointer<QObject> obj(c.create());
|
||||||
QVERIFY(obj);
|
QVERIFY(obj);
|
||||||
|
|
||||||
QQmlType type = QQmlMetaType::qmlType(QString("ImplicitType"), QString(""), 1, 0);
|
QQmlType type = QQmlMetaType::qmlType(QString("ImplicitType"), QString(""), 1, 0);
|
||||||
|
@ -324,7 +324,7 @@ void tst_qqmlmetatype::externalEnums()
|
||||||
qmlRegisterSingletonType<ExternalEnums>("x.y.z", 1, 0, "ExternalEnums", ExternalEnums::create);
|
qmlRegisterSingletonType<ExternalEnums>("x.y.z", 1, 0, "ExternalEnums", ExternalEnums::create);
|
||||||
|
|
||||||
QQmlComponent c(&engine, testFileUrl("testExternalEnums.qml"));
|
QQmlComponent c(&engine, testFileUrl("testExternalEnums.qml"));
|
||||||
QObject *obj = c.create();
|
QScopedPointer<QObject> obj(c.create());
|
||||||
QVERIFY(obj);
|
QVERIFY(obj);
|
||||||
QVariant a = obj->property("a");
|
QVariant a = obj->property("a");
|
||||||
QCOMPARE(a.type(), QVariant::Int);
|
QCOMPARE(a.type(), QVariant::Int);
|
||||||
|
@ -552,7 +552,8 @@ void tst_qqmlmetatype::unregisterAttachedProperties()
|
||||||
QCOMPARE(attachedType.attachedPropertiesType(QQmlEnginePrivate::get(&e)),
|
QCOMPARE(attachedType.attachedPropertiesType(QQmlEnginePrivate::get(&e)),
|
||||||
attachedType.metaObject());
|
attachedType.metaObject());
|
||||||
|
|
||||||
QVERIFY(c.create());
|
QScopedPointer<QObject> obj(c.create());
|
||||||
|
QVERIFY(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
qmlClearTypeRegistrations();
|
qmlClearTypeRegistrations();
|
||||||
|
@ -571,7 +572,8 @@ void tst_qqmlmetatype::unregisterAttachedProperties()
|
||||||
QCOMPARE(attachedType.attachedPropertiesType(QQmlEnginePrivate::get(&e)),
|
QCOMPARE(attachedType.attachedPropertiesType(QQmlEnginePrivate::get(&e)),
|
||||||
attachedType.metaObject());
|
attachedType.metaObject());
|
||||||
|
|
||||||
QVERIFY(c.create());
|
QScopedPointer<QObject> obj(c.create());
|
||||||
|
QVERIFY(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue