diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2017-09-01 15:09:37 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2017-09-27 12:56:04 +0000 |
commit | 0a2e0c3880a7d76a65399854b15031c8e9c8dde8 (patch) | |
tree | 3e0d5fc6e21e8114760be848fc69b04213349cf7 /src/lib/corelib/buildgraph/jscommandexecutor.cpp | |
parent | 72eedbb0a4a4acbe5cafe574a185438299f07367 (diff) |
Fix recursion issue when releasing ResourceAcquiringScriptObjects
Calling releaseResourcesOfScriptObjects in QScriptEngine::evaluate does
not guarantee that the function is called in all circumstances, because
evaluate is not virtual. Worse, it might be called at the wrong time by
a recursive evaluate.
Remove the evaluate overloads, and call releaseResourcesOfScriptObjects
manually after the evaluation of
- Probe.configure,
- Rule.outputArtifacts,
- Rule.prepare,
- and JavaScriptCommand.sourceCode.
Change-Id: Ie4ed0c2d0895a13a8930d7b35c0f22a8d62dc34b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph/jscommandexecutor.cpp')
-rw-r--r-- | src/lib/corelib/buildgraph/jscommandexecutor.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/corelib/buildgraph/jscommandexecutor.cpp b/src/lib/corelib/buildgraph/jscommandexecutor.cpp index 1d256fa2c..3e9d35cfc 100644 --- a/src/lib/corelib/buildgraph/jscommandexecutor.cpp +++ b/src/lib/corelib/buildgraph/jscommandexecutor.cpp @@ -135,6 +135,7 @@ private: if (importScopeForSourceCode.isObject()) scriptEngine->currentContext()->pushScope(importScopeForSourceCode); scriptEngine->evaluate(cmd->sourceCode()); + scriptEngine->releaseResourcesOfScriptObjects(); if (importScopeForSourceCode.isObject()) scriptEngine->currentContext()->popScope(); scriptEngine->setGlobalObject(scope.prototype()); |