From 25f765cbd9067c1ebb61721efbe471d9100d9237 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 10 Feb 2021 19:20:21 +0100 Subject: Unregister value types when tearing down QML types Move the value type registry into QQmlMetaTypeData. This way we can conveniently drop the relevant entries when unregistering a type. Fixes: QTBUG-86946 Change-Id: Id024a34a8b2b622fd9417fc0e52864b43c66cc01 Reviewed-by: Fabian Kosmale --- tests/auto/qml/qqmlpropertycache/BLACKLIST | 2 -- tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp | 2 ++ tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 tests/auto/qml/qqmlpropertycache/BLACKLIST (limited to 'tests/auto/qml') diff --git a/tests/auto/qml/qqmlpropertycache/BLACKLIST b/tests/auto/qml/qqmlpropertycache/BLACKLIST deleted file mode 100644 index d27b6a6290..0000000000 --- a/tests/auto/qml/qqmlpropertycache/BLACKLIST +++ /dev/null @@ -1,2 +0,0 @@ -[derivedGadgetMethod] -* diff --git a/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp b/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp index 875a174814..4c04849d1f 100644 --- a/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp +++ b/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp @@ -654,6 +654,8 @@ void tst_qqmlpropertycache::metaObjectsForRootElements() void tst_qqmlpropertycache::derivedGadgetMethod() { + metaObjectsForRootElements(); + qmlRegisterTypesAndRevisions("Test.PropertyCache", 1); QQmlEngine engine; QQmlComponent c(&engine, testFileUrl("derivedGadgetMethod.qml")); diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp index f615060ce3..80360b0912 100644 --- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp +++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp @@ -1823,8 +1823,8 @@ void tst_qqmlvaluetypes::scarceTypes() // These should not be treated as value types because we want the scarce resource // mechanism to clear them when going out of scope. The scarce resource mechanism // only works on QV4::VariantObject as that has an additional level of redirection. - QVERIFY(!QQmlValueTypeFactory::isValueType(QMetaType::fromType())); - QVERIFY(!QQmlValueTypeFactory::isValueType(QMetaType::fromType())); + QVERIFY(!QQmlMetaType::isValueType(QMetaType::fromType())); + QVERIFY(!QQmlMetaType::isValueType(QMetaType::fromType())); QV4::ExecutionEngine engine; QV4::Scope scope(&engine); @@ -1839,7 +1839,7 @@ void tst_qqmlvaluetypes::scarceTypes() } #define CHECK_TYPE_IS_NOT_VALUETYPE(Type, typeId, cppType) \ - QVERIFY(!QQmlValueTypeFactory::isValueType(QMetaType(QMetaType::Type))); + QVERIFY(!QQmlMetaType::isValueType(QMetaType(QMetaType::Type))); void tst_qqmlvaluetypes::nonValueTypes() { -- cgit v1.2.3