Showing the changes to libraries/script-engine/src/ScriptEngines.cpp (1 of 4 files). Show all
Unified · Split
| @@ -118,7 +118,7 @@ void ScriptEngines::registerScriptInitializer(ScriptInitializer initializer) { · 117 unmodified lines | ||
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | void ScriptEngines::addScriptEngine(ScriptEngine* engine) { |
| 121 | − if (!_stoppingAllScripts) { | |
| 121 | + if (!_stopped) { | |
| 122 | 122 | QMutexLocker locker(&_allScriptsMutex); |
| 123 | 123 | _allKnownScriptEngines.insert(engine); |
| 124 | 124 | } |
| @@ -128,15 +128,14 @@ void ScriptEngines::removeScriptEngine(ScriptEngine* engine) { · 3 unmodified lines | ||
| 128 | 128 | // If we're not already in the middle of stopping all scripts, then we should remove ourselves |
| 129 | 129 | // from the list of running scripts. We don't do this if we're in the process of stopping all scripts |
| 130 | 130 | // because that method removes scripts from its list as it iterates them |
| 131 | − if (!_stoppingAllScripts) { | |
| 131 | + if (!_stopped) { | |
| 132 | 132 | QMutexLocker locker(&_allScriptsMutex); |
| 133 | 133 | _allKnownScriptEngines.remove(engine); |
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | void ScriptEngines::shutdownScripting() { |
| 138 | − _stoppingAllScripts = true; | |
| 139 | − ScriptEngine::_stoppingAllScripts = true; | |
| 138 | + _stopped = true; | |
| 140 | 139 | QMutexLocker locker(&_allScriptsMutex); |
| 141 | 140 | qCDebug(scriptengine) << "Stopping all scripts.... currently known scripts:" << _allKnownScriptEngines.size(); |
| 142 | 141 | |