aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-11-28 10:05:24 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-12-19 18:52:07 +0100
commit05bf96997c52775f14cfd4e34d25187feec897e0 (patch)
treedba1cb94f6a318d715343c75d54193bb170bb967 /src/qml/qml
parentf9d4cd6fd75617b2bddde4ba591b77d1d6b4727b (diff)
Return Heap::ExecutionContext for globalContext()
Change-Id: Ide7c81735be4662ff45bf268cfe750ff1f784453 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp6
-rw-r--r--src/qml/qml/qqmlvaluetypewrapper.cpp4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index 2e98fd3e37..be38b86d75 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -265,7 +265,8 @@ bool QQmlObjectCreator::populateDeferredProperties(QObject *instance)
sharedState->allJavaScriptObjects = valueScope.alloc(compiledData->totalObjectCount);
QV4::ScopedObject qmlScope(valueScope, QV4::QmlContextWrapper::qmlScope(QV8Engine::get(engine), context, _scopeObject));
- QV4::Scoped<QV4::QmlBindingWrapper> qmlBindingWrapper(valueScope, v4->memoryManager->alloc<QV4::QmlBindingWrapper>(v4->rootContext(), qmlScope));
+ QV4::ScopedContext global(valueScope, valueScope.engine->rootContext());
+ QV4::Scoped<QV4::QmlBindingWrapper> qmlBindingWrapper(valueScope, v4->memoryManager->alloc<QV4::QmlBindingWrapper>(global, qmlScope));
// ### GC
QV4::ExecutionContext *qmlContext = QV4::ScopedContext(valueScope, qmlBindingWrapper->context()).getPointer();
@@ -1176,7 +1177,8 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isCo
QV4::Scope valueScope(v4);
QV4::ScopedObject qmlScope(valueScope, QV4::QmlContextWrapper::qmlScope(QV8Engine::get(engine), context, _scopeObject));
- QV4::Scoped<QV4::QmlBindingWrapper> qmlBindingWrapper(valueScope, v4->memoryManager->alloc<QV4::QmlBindingWrapper>(v4->rootContext(), qmlScope));
+ QV4::ScopedContext global(valueScope, valueScope.engine->rootContext());
+ QV4::Scoped<QV4::QmlBindingWrapper> qmlBindingWrapper(valueScope, v4->memoryManager->alloc<QV4::QmlBindingWrapper>(global, qmlScope));
// ### GC
QV4::ExecutionContext *qmlContext = QV4::ScopedContext(valueScope, qmlBindingWrapper->context()).getPointer();
diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp
index 97da7ebf71..dba60047e6 100644
--- a/src/qml/qml/qqmlvaluetypewrapper.cpp
+++ b/src/qml/qml/qqmlvaluetypewrapper.cpp
@@ -309,7 +309,9 @@ ReturnedValue QmlValueTypeWrapper::get(Managed *m, String *name, bool *hasProper
if (result->isFunction()) {
// calling a Q_INVOKABLE function of a value type
- return QV4::QObjectMethod::create(v4->rootContext(), r->d()->type, result->coreIndex);
+ Scope scope(v4);
+ ScopedContext c(scope, v4->rootContext());
+ return QV4::QObjectMethod::create(c, r->d()->type, result->coreIndex);
}
#define VALUE_TYPE_LOAD(metatype, cpptype, constructor) \