diff options
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index da3f3226f6..7e87b8be75 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -2112,7 +2112,11 @@ void ExecutionEngine::callInContext(Function *function, QObject *self, QMetaType *types) { QV4::Scope scope(this); - ExecutionContext *ctx = currentStackFrame ? currentContext() : scriptContext(); + // NB: always use scriptContext() here as this method ignores whether + // there's already a stack frame. the method is called from C++ (through + // QQmlEngine::executeRuntimeFunction()) and thus the caller must ensure + // correct setup + QV4::ExecutionContext *ctx = scriptContext(); QV4::Scoped<QV4::QmlContext> qmlContext(scope, QV4::QmlContext::create(ctx, ctxtdata, self)); if (!args) { Q_ASSERT(argc == 0); |
