diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-11 13:55:01 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 13:13:18 +0200 |
commit | 1a2a83f80ba4ecc28eba72af57c81bd43a45946c (patch) | |
tree | c2e4eb4d9bb57873ca340f6bbbf2342b36c91452 /src/qml/jsapi | |
parent | 826550af450b39f47a3c00ec316acf1e317f12c6 (diff) |
Use a ReturnedValue for Managed::call()
Change-Id: Ief2d75e9789dd367c603d90dc0fe5316a0d055e3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsapi')
-rw-r--r-- | src/qml/jsapi/qjsvalue.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index beff645005..ea5c021231 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -506,6 +506,7 @@ QJSValue QJSValue::call(const QJSValueList &args) ExecutionEngine *engine = d->engine; assert(engine); + ValueScope scope(engine); ScopedCallData callData(engine, args.length()); callData->thisObject = Value::fromObject(engine->globalObject); for (int i = 0; i < args.size(); ++i) { @@ -516,7 +517,7 @@ QJSValue QJSValue::call(const QJSValueList &args) callData->args[i] = args.at(i).d->getValue(engine); } - Value result; + ScopedValue result(scope); QV4::ExecutionContext *ctx = engine->current; try { result = f->call(callData); @@ -556,6 +557,7 @@ QJSValue QJSValue::callWithInstance(const QJSValue &instance, const QJSValueList ExecutionEngine *engine = d->engine; assert(engine); + ValueScope scope(engine); if (!instance.d->checkEngine(engine)) { qWarning("QJSValue::call() failed: cannot call function with thisObject created in a different engine"); @@ -572,7 +574,7 @@ QJSValue QJSValue::callWithInstance(const QJSValue &instance, const QJSValueList callData->args[i] = args.at(i).d->getValue(engine); } - Value result; + ScopedValue result(scope); QV4::ExecutionContext *ctx = engine->current; try { result = f->call(callData); |