aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlengine.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-02-10 09:54:35 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2020-02-10 10:05:13 +0100
commit4f0c9986069c690e8ed7a7d2b42dfbce5c492368 (patch)
treee0a143c612f26c7b238eab78675fe3a78cf45788 /src/qml/qml/qqmlengine.cpp
parent6d0a453f41d304239285d64b06612c36922be701 (diff)
Fix QML type unregistration
When the QQmlEngine gets destroyed, it unregisters all previously registered composite types. So far it only removed them from Qt's metatype system. This is however not enough, as the types also need to be removed from the global qmlLists datastructure. We achieve this by calling QQmlMetaType::unregisterInternalCompositeType. Task-number: QTBUG-81772 Change-Id: Iba124c890bc4613ffbb110003d74fe3a912f8df6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlengine.cpp')
-rw-r--r--src/qml/qml/qqmlengine.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 07d5429423..f97612ab75 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -683,11 +683,7 @@ QQmlEnginePrivate::~QQmlEnginePrivate()
for (auto iter = m_compositeTypes.cbegin(), end = m_compositeTypes.cend(); iter != end; ++iter) {
iter.value()->isRegisteredWithEngine = false;
-
- // since unregisterInternalCompositeType() will not be called in this
- // case, we have to clean up the type registration manually
- QMetaType::unregisterType(iter.value()->metaTypeId);
- QMetaType::unregisterType(iter.value()->listMetaTypeId);
+ QQmlMetaType::unregisterInternalCompositeType({iter.value()->metaTypeId, iter.value()->listMetaTypeId});
}
#if QT_CONFIG(qml_debug)
delete profiler;