aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlengine.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-08-24 14:52:30 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2020-08-28 13:49:14 +0200
commit229987d91505203e5a1577651b65880e58239ac7 (patch)
tree4a42a347a831824d2ffc8f8dee6a90a0dd7d0859 /src/qml/qml/qqmlengine.cpp
parent2afed94c70913e018198422ef222c9168326d09c (diff)
Do proper memory management on the metatype interfaces we create
Those interfaces are always registered in pairs. Add an external refcount to CompositeMetaTypeIds, and do registration and de-registration through this class. Change-Id: I4f3a53ad935a43a734d6506ffc768f507b48ee1f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlengine.cpp')
-rw-r--r--src/qml/qml/qqmlengine.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 4326002575..f1c79fe8b3 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -649,10 +649,8 @@ QQmlEnginePrivate::~QQmlEnginePrivate()
QQmlMetaType::freeUnusedTypesAndCaches();
- for (auto iter = m_compositeTypes.cbegin(), end = m_compositeTypes.cend(); iter != end; ++iter) {
+ for (auto iter = m_compositeTypes.cbegin(), end = m_compositeTypes.cend(); iter != end; ++iter)
iter.value()->isRegisteredWithEngine = false;
- QQmlMetaType::unregisterInternalCompositeType(iter.value()->typeIds);
- }
#if QT_CONFIG(qml_debug)
delete profiler;
#endif