diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-05 00:03:52 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-08-08 18:58:37 +0000 |
commit | f284d73ccece0490b4a227c788b9415a59a38d9c (patch) | |
tree | 729d1b8ef68c941bdda322fa6dc3c17b62d1a69e /src/qml/jsruntime/qv4scopedvalue_p.h | |
parent | 68a717a9cd5a5b092268eaddd3552becc55c74ab (diff) |
Avoid creating a separate Scope in the ExecutionContextSaver
There's no reason this class should create a scope on it's own.
Change-Id: I93bddea8be42a908a1aca1bcb0ec867aae0d29f8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4scopedvalue_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4scopedvalue_p.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h index 7df723e9d0..f6cb6fda5d 100644 --- a/src/qml/jsruntime/qv4scopedvalue_p.h +++ b/src/qml/jsruntime/qv4scopedvalue_p.h @@ -401,19 +401,19 @@ struct ScopedProperty struct ExecutionContextSaver { - Scope scope; // this makes sure that a reference to context on the JS stack goes out of scope as soon as the context is not used anymore. + ExecutionEngine *engine; ExecutionContext *savedContext; - ExecutionContextSaver(const Scope &scope) - : scope(scope.engine) + ExecutionContextSaver(ExecutionEngine *engine) + : engine(engine) { - savedContext = scope.engine->currentContext; + savedContext = engine->currentContext; } ~ExecutionContextSaver() { - Q_ASSERT(scope.engine->jsStackTop > scope.engine->currentContext); - scope.engine->currentContext = savedContext; - scope.engine->current = savedContext->d(); + Q_ASSERT(engine->jsStackTop > engine->currentContext); + engine->currentContext = savedContext; + engine->current = savedContext->d(); } }; |