Showing the changes to libraries/script-engine/src/ScriptEngines.cpp (1 of 1 file). Show all
Unified · Split
| @@ -160,6 +160,7 @@ void ScriptEngines::shutdownScripting() { · 159 unmodified lines | ||
| 160 | 160 | scriptEngine->disconnect(this); |
| 161 | 161 | |
| 162 | 162 | // Gracefully stop the engine's scripting thread |
| 163 | + scriptEngine->setIsStopping(); | |
| 163 | 164 | scriptEngine->stop(); |
| 164 | 165 | |
| 165 | 166 | // We need to wait for the engine to be done running before we proceed, because we don't |
| @@ -353,7 +354,6 @@ void ScriptEngines::stopAllScripts(bool restart) { · 187 unmodified lines | ||
| 353 | 354 | } |
| 354 | 355 | it.value()->setIsStopping(); |
| 355 | 356 | QMetaObject::invokeMethod(it.value(), "stop"); |
| 356 | − //it.value()->stop(); | |
| 357 | 357 | qCDebug(scriptengine) << "stopping script..." << it.key(); |
| 358 | 358 | } |
| 359 | 359 | } |
| @@ -370,13 +370,13 @@ bool ScriptEngines::stopScript(const QString& rawScriptURL, bool restart) { · 10 unmodified lines | ||
| 370 | 370 | if (_scriptEnginesHash.contains(scriptURL)) { |
| 371 | 371 | ScriptEngine* scriptEngine = _scriptEnginesHash[scriptURL]; |
| 372 | 372 | if (restart) { |
| 373 | − scriptEngine->setIsStopping(); | |
| 374 | 373 | auto scriptCache = DependencyManager::get<ScriptCache>(); |
| 375 | 374 | scriptCache->deleteScript(scriptURL); |
| 376 | 375 | connect(scriptEngine, &ScriptEngine::finished, this, [this](QString scriptName, ScriptEngine* engine) { |
| 377 | 376 | reloadScript(scriptName); |
| 378 | 377 | }); |
| 379 | 378 | } |
| 379 | + scriptEngine->setIsStopping(); | |
| 380 | 380 | scriptEngine->stop(); |
| 381 | 381 | stoppedScript = true; |
| 382 | 382 | qCDebug(scriptengine) << "stopping script..." << scriptURL; |