aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsapi/qjsengine.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-04-28 19:15:25 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-17 07:40:03 +0000
commita914b186671090f1ec2ac80fa14b4aef19e8d563 (patch)
tree08ddf9049c59cd6c12a4e2c5eeeb86eb3a46d75c /src/qml/jsapi/qjsengine.cpp
parent668e4b739a92dd9dbec2d4df76fe9197506c25d9 (diff)
Store rootcontext in a GC safe way
Change-Id: If81d638c0ccd2b34df918ae5055e309f4eae031f Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/jsapi/qjsengine.cpp')
-rw-r--r--src/qml/jsapi/qjsengine.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp
index f728f95a30..d9615d496f 100644
--- a/src/qml/jsapi/qjsengine.cpp
+++ b/src/qml/jsapi/qjsengine.cpp
@@ -318,7 +318,7 @@ QJSValue QJSEngine::evaluate(const QString& program, const QString& fileName, in
QV4::ExecutionEngine *v4 = d->m_v4Engine;
QV4::Scope scope(v4);
QV4::ScopedContext ctx(scope, v4->currentContext());
- if (ctx->d() != v4->rootContext())
+ if (ctx->d() != v4->rootContext()->d())
ctx = v4->pushGlobalContext();
QV4::ScopedValue result(scope);
@@ -330,7 +330,7 @@ QJSValue QJSEngine::evaluate(const QString& program, const QString& fileName, in
result = script.run();
if (scope.engine->hasException)
result = v4->catchException();
- if (ctx->d() != v4->rootContext())
+ if (ctx->d() != v4->rootContext()->d())
v4->popContext();
return QJSValue(v4, result->asReturnedValue());
}