diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-06-27 08:55:01 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-08-02 16:33:17 +0000 |
commit | d621573d121348fed943dfe73ec9a89b27a92e52 (patch) | |
tree | c93541bab131ff31302cedeb60edf21ba77bea79 /src/qml/compiler/qv4compileddata.cpp | |
parent | 48c09a85ce397979c7e706e3694c879ffe456e09 (diff) |
Move the m_qmlLists member in the QML engine to QQmlMetaType
This is a pure metatype id to metatype id mapping, nothing
in there is specific to a QML engine instance. Thus move the
mapping to QQmlMetaType and make it global for all engines.
Task-number: QTBUG-61536
Change-Id: I3792567bc9f585e3e0fbbad94efd1ec3a0db3de0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compileddata.cpp')
-rw-r--r-- | src/qml/compiler/qv4compileddata.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index 929339b70d..72b2c3fd07 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -211,8 +211,9 @@ void CompilationUnit::unlink() if (isRegisteredWithEngine) { Q_ASSERT(data && quint32(propertyCaches.count()) > data->indexOfRootObject && propertyCaches.at(data->indexOfRootObject)); - QQmlEnginePrivate *qmlEngine = QQmlEnginePrivate::get(engine); - qmlEngine->unregisterInternalCompositeType(this); + if (engine) + QQmlEnginePrivate::get(engine)->unregisterInternalCompositeType(this); + QQmlMetaType::unregisterInternalCompositeType(this); isRegisteredWithEngine = false; } @@ -285,9 +286,10 @@ IdentifierHash<int> CompilationUnit::namedObjectsPerComponent(int componentObjec void CompilationUnit::finalize(QQmlEnginePrivate *engine) { // Add to type registry of composites - if (propertyCaches.needsVMEMetaObject(data->indexOfRootObject)) + if (propertyCaches.needsVMEMetaObject(data->indexOfRootObject)) { + QQmlMetaType::registerInternalCompositeType(this); engine->registerInternalCompositeType(this); - else { + } else { const QV4::CompiledData::Object *obj = objectAt(data->indexOfRootObject); auto *typeRef = resolvedTypes.value(obj->inheritedTypeNameIndex); Q_ASSERT(typeRef); |