aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/jsruntime/qv4context.cpp8
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp1
-rw-r--r--src/qml/jsruntime/qv4script.cpp1
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp1
4 files changed, 6 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index d5e2a57b20..1f561e5f58 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -95,14 +95,18 @@ Heap::CatchContext *ExecutionContext::newCatchContext(String *exceptionVarName,
Heap::QmlContext *ExecutionContext::newQmlContext(QmlContextWrapper *qml)
{
- return d()->engine->memoryManager->alloc<QmlContext>(this, qml);
+ Heap::QmlContext *c = d()->engine->memoryManager->alloc<QmlContext>(this, qml);
+ d()->engine->popContext();
+ return c;
}
Heap::QmlContext *ExecutionContext::newQmlContext(QQmlContextData *context, QObject *scopeObject)
{
Scope scope(this);
Scoped<QmlContextWrapper> qml(scope, QmlContextWrapper::qmlScope(scope.engine, context, scopeObject));
- return d()->engine->memoryManager->alloc<QmlContext>(this, qml);
+ Heap::QmlContext *c = d()->engine->memoryManager->alloc<QmlContext>(this, qml);
+ d()->engine->popContext();
+ return c;
}
void ExecutionContext::createMutableBinding(String *name, bool deletable)
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index 525f806d7a..1cff952401 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -212,7 +212,6 @@ Heap::FunctionObject *FunctionObject::createQmlFunction(QQmlContextData *qmlCont
QV4::Scope valueScope(engine);
ScopedContext global(valueScope, valueScope.engine->rootContext());
QV4::Scoped<QmlContext> wrapperContext(valueScope, global->newQmlContext(qmlContext, scopeObject));
- engine->popContext();
if (!signalParameters.isEmpty()) {
if (error)
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp
index c221a99959..493e35c852 100644
--- a/src/qml/jsruntime/qv4script.cpp
+++ b/src/qml/jsruntime/qv4script.cpp
@@ -111,7 +111,6 @@ Heap::QmlBindingWrapper::QmlBindingWrapper(QV4::ExecutionContext *scope, Functio
Scoped<QV4::QmlBindingWrapper> protectThis(s, this);
this->scope = scope->newQmlContext(qml);
- internalClass->engine->popContext();
}
ReturnedValue QmlBindingWrapper::call(const Managed *that, CallData *callData)
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index 12415e1583..ed58df843b 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -991,7 +991,6 @@ QV4::Heap::QmlContext *QQmlObjectCreator::currentQmlContext()
QV4::Scope valueScope(v4);
QV4::ScopedContext global(valueScope, v4->rootContext());
_qmlContext->setM(global->newQmlContext(context, _scopeObject));
- v4->popContext();
}
return _qmlContext->d();
}