From 39f1e0d66dc434e764731fbfed29c8fd98d217aa Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 13 Jan 2015 09:01:29 +0100 Subject: Make sure we always have an engine when assigning to a Persistent This prepares things for a rewrite of the internals of Persistent. Change-Id: Ib93ec5911984d1bfce87ffdc3f86bc75f6ecafe9 Reviewed-by: Simon Hausmann --- src/qml/qml/qqmlvmemetaobject.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/qml/qml/qqmlvmemetaobject.cpp') diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp index 6636b3a8e4..40ae8ce35a 100644 --- a/src/qml/qml/qqmlvmemetaobject.cpp +++ b/src/qml/qml/qqmlvmemetaobject.cpp @@ -608,7 +608,7 @@ QQmlVMEMetaObject::QQmlVMEMetaObject(QObject *obj, QV4::Function *runtimeFunction = compilationUnit->runtimeFunctions[data->runtimeFunctionIndex]; o = QV4::FunctionObject::createScriptFunction(qmlBindingContext, runtimeFunction); - v8methods[index] = o; + v8methods[index].set(qmlBindingContext->engine(), o); } } } @@ -1183,7 +1183,7 @@ void QQmlVMEMetaObject::setVmeMethod(int index, QV4::ValueRef function) v8methods = new QV4::PersistentValue[metaData->methodCount]; int methodIndex = index - methodOffset() - plainSignals; - v8methods[methodIndex] = function; + v8methods[methodIndex].set(function->asObject()->engine(), function); } QV4::ReturnedValue QQmlVMEMetaObject::vmeProperty(int index) @@ -1253,7 +1253,7 @@ void QQmlVMEMetaObject::allocateVarPropertiesArray() assert(qml); QV4::ExecutionEngine *v4 = QV8Engine::getV4(qml->handle()); QV4::Scope scope(v4); - varProperties = QV4::ScopedValue(scope, v4->newArrayObject(metaData->varPropertyCount)); + varProperties.set(scope.engine, v4->newArrayObject(metaData->varPropertyCount)); varPropertiesInitialized = true; } -- cgit v1.2.3