diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2017-09-08 11:04:30 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-09-08 11:04:30 +0200 |
commit | bde8c3cd9583ed9f3bdfc36a8699f56db20a6928 (patch) | |
tree | 33246b027739aafd72f9f289876f69627537f2b3 /src/qml/compiler/qv4compileddata.cpp | |
parent | b63bc868875d7571bc332804f984824cff7c5b78 (diff) | |
parent | 685ad676a84bf48602a5da8f7171792686b94a73 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/new-backend
Conflicts:
src/qml/compiler/qv4isel_moth.cpp
src/qml/compiler/qv4jsir.cpp
src/qml/jsruntime/qv4mathobject.cpp
Change-Id: I426f1f4f0a5302b5bcff021de11766a03fec7637
Diffstat (limited to 'src/qml/compiler/qv4compileddata.cpp')
-rw-r--r-- | src/qml/compiler/qv4compileddata.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index 58588e4ad5..890f4c47de 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -97,6 +97,7 @@ static QString cacheFilePath(const QUrl &url) CompilationUnit::CompilationUnit() : data(0) , engine(0) + , qmlEngine(0) , runtimeLookups(0) , runtimeRegularExpressions(0) , runtimeClasses(0) @@ -213,8 +214,8 @@ void CompilationUnit::unlink() if (isRegisteredWithEngine) { Q_ASSERT(data && quint32(propertyCaches.count()) > data->indexOfRootObject && propertyCaches.at(data->indexOfRootObject)); - if (engine) - QQmlEnginePrivate::get(engine)->unregisterInternalCompositeType(this); + if (qmlEngine) + qmlEngine->unregisterInternalCompositeType(this); QQmlMetaType::unregisterInternalCompositeType(this); isRegisteredWithEngine = false; } @@ -231,6 +232,7 @@ void CompilationUnit::unlink() resolvedTypes.clear(); engine = 0; + qmlEngine = 0; free(runtimeStrings); runtimeStrings = 0; delete [] runtimeLookups; @@ -260,9 +262,6 @@ void CompilationUnit::markObjects(QV4::MarkStack *markStack) void CompilationUnit::destroy() { - QQmlEngine *qmlEngine = 0; - if (engine && engine->v8Engine) - qmlEngine = engine->v8Engine->engine(); if (qmlEngine) QQmlEnginePrivate::deleteInEngineThread(qmlEngine, this); else @@ -285,12 +284,14 @@ IdentifierHash<int> CompilationUnit::namedObjectsPerComponent(int componentObjec return *it; } -void CompilationUnit::finalize(QQmlEnginePrivate *engine) +void CompilationUnit::finalizeCompositeType(QQmlEnginePrivate *qmlEngine) { + this->qmlEngine = qmlEngine; + // Add to type registry of composites if (propertyCaches.needsVMEMetaObject(data->indexOfRootObject)) { QQmlMetaType::registerInternalCompositeType(this); - engine->registerInternalCompositeType(this); + qmlEngine->registerInternalCompositeType(this); } else { const QV4::CompiledData::Object *obj = objectAt(data->indexOfRootObject); auto *typeRef = resolvedTypes.value(obj->inheritedTypeNameIndex); |