diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-06-23 13:20:23 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-08-02 16:32:43 +0000 |
commit | 49a11e882059ee1729f776722e085dd21d378c36 (patch) | |
tree | 1b0fe9a471766d97d03602502acc57c00df93b36 /src/qml/jsruntime/qv4qmlcontext.cpp | |
parent | 97165444ac6954766d53c3eb62eb1614644c7264 (diff) |
Use QQmlType by value
QQmlType is now refcounted, and we need to use it by
value, to control it's lifetime properly. This is
required, so we can clean up the QQmlMetaTypeData
cache on engine destruction and with trimComponentCache()
Task-number: QTBUG-61536
Change-Id: If86391c86ea20a646ded7c9925d8f743f628fb91
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4qmlcontext.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4qmlcontext.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4qmlcontext.cpp b/src/qml/jsruntime/qv4qmlcontext.cpp index 9411e2b8e0..144ab1b1a5 100644 --- a/src/qml/jsruntime/qv4qmlcontext.cpp +++ b/src/qml/jsruntime/qv4qmlcontext.cpp @@ -142,8 +142,8 @@ ReturnedValue QmlContextWrapper::get(const Managed *m, String *name, bool *hasPr if (r.scriptIndex != -1) { QV4::ScopedObject scripts(scope, context->importedScripts.valueRef()); return scripts->getIndexed(r.scriptIndex); - } else if (r.type) { - return QmlTypeWrapper::create(v4, scopeObject, *r.type); + } else if (r.type.isValid()) { + return QmlTypeWrapper::create(v4, scopeObject, r.type); } else if (r.importNamespace) { return QmlTypeWrapper::create(v4, scopeObject, context->imports, r.importNamespace); } |