diff options
author | Lars Knoll <lars.knoll@qt.io> | 2016-11-29 12:53:04 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2016-11-29 15:07:16 +0000 |
commit | 550290250a99f38f6ff0a891d6e75e21deec8cbf (patch) | |
tree | 4488a6c8b7d8af802e8c0f07ed8001180d741927 /src/qml/qml | |
parent | fc5c77e371867cf6be8e270e452e21e5ac338283 (diff) |
Fix caching of the current qmlContext in QQmlObjectCreator
A context is not a QV4::Object, just a QV4::Managed. Testing for
Object here lead to us creating a new QV4::QmlContext every time
this method got called instead of sharing it.
Reduces memory consumption and improves the performance of
some of the creation benchmarks in qmlbench by ~20%.
Change-Id: I20c0ad52133aa0cb40c9d2551fd635bef8b7d90a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index 2218f277d6..004e18576b 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -1016,7 +1016,7 @@ void QQmlObjectCreator::registerObjectWithContextById(const QV4::CompiledData::O QV4::Heap::QmlContext *QQmlObjectCreator::currentQmlContext() { - if (!_qmlContext->objectValue()) + if (!_qmlContext->isManaged()) _qmlContext->setM(v4->rootContext()->newQmlContext(context, _scopeObject)); return _qmlContext->d(); |