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