diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-08-24 16:47:48 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-09-15 19:12:40 +0000 |
commit | fb52dab6b41ddd6955cb14e1474f90ee5333dac9 (patch) | |
tree | a6cfe97160f1f9b1b48ba35977b13e6bdce52b47 /src/qml/qml/qqmlobjectcreator.cpp | |
parent | da705f4036356a3203957c2a7852fa396227fc78 (diff) |
Further cleanups
Reduce usage of ScopedContext.
Change-Id: I84a6a7478065de3398fd0b21596ca1308e78ceb3
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp index ed58df843b..f371a369a1 100644 --- a/src/qml/qml/qqmlobjectcreator.cpp +++ b/src/qml/qml/qqmlobjectcreator.cpp @@ -987,11 +987,9 @@ void QQmlObjectCreator::registerObjectWithContextById(int objectIndex, QObject * QV4::Heap::QmlContext *QQmlObjectCreator::currentQmlContext() { - if (!_qmlContext->objectValue()) { - QV4::Scope valueScope(v4); - QV4::ScopedContext global(valueScope, v4->rootContext()); - _qmlContext->setM(global->newQmlContext(context, _scopeObject)); - } + if (!_qmlContext->objectValue()) + _qmlContext->setM(v4->rootContext()->newQmlContext(context, _scopeObject)); + return _qmlContext->d(); } |