aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4executablecompilationunit.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/jsruntime/qv4executablecompilationunit.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/jsruntime/qv4executablecompilationunit.cpp')
-rw-r--r--src/qml/jsruntime/qv4executablecompilationunit.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4executablecompilationunit.cpp b/src/qml/jsruntime/qv4executablecompilationunit.cpp
index 9d8332ea55..01700fd05c 100644
--- a/src/qml/jsruntime/qv4executablecompilationunit.cpp
+++ b/src/qml/jsruntime/qv4executablecompilationunit.cpp
@@ -303,7 +303,6 @@ void ExecutableCompilationUnit::unlink()
if (qmlEngine)
qmlEngine->unregisterInternalCompositeType(this);
isRegisteredWithEngine = false;
- QQmlMetaType::unregisterInternalCompositeType(typeIds);
}
propertyCaches.clear();
@@ -410,7 +409,7 @@ void ExecutableCompilationUnit::finalizeCompositeType(QQmlEnginePrivate *qmlEngi
if (propertyCaches.needsVMEMetaObject(/*root object*/0)) {
// typeIds is only valid for types that have references to themselves.
if (!types.isValid())
- types = QQmlMetaType::registerInternalCompositeType(rootPropertyCache()->className());
+ types = CompositeMetaTypeIds::fromCompositeName(rootPropertyCache()->className());
typeIds = types;
qmlEngine->registerInternalCompositeType(this);