Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all
Unified · Split
| @@ -4344,6 +4344,8 @@ void Application::scriptFinished(const QString& scriptName) { · 4343 unmodified lines | |||
| 4344 | } | 4344 | } |
| 4345 | 4345 | ||
| 4346 | void Application::stopAllScripts(bool restart) { | 4346 | void Application::stopAllScripts(bool restart) { |
| 4347 | auto scriptCache = DependencyManager::get<ScriptCache>(); | ||
| 4348 | |||
| 4347 | // stops all current running scripts | 4349 | // stops all current running scripts |
| 4348 | for (QHash<QString, ScriptEngine*>::const_iterator it = _scriptEnginesHash.constBegin(); | 4350 | for (QHash<QString, ScriptEngine*>::const_iterator it = _scriptEnginesHash.constBegin(); |
| 4349 | it != _scriptEnginesHash.constEnd(); it++) { | 4351 | it != _scriptEnginesHash.constEnd(); it++) { |
| @@ -4351,6 +4353,7 @@ void Application::stopAllScripts(bool restart) { · 1 unmodified line | |||
| 4351 | continue; | 4353 | continue; |
| 4352 | } | 4354 | } |
| 4353 | if (restart && it.value()->isUserLoaded()) { | 4355 | if (restart && it.value()->isUserLoaded()) { |
| 4356 | scriptCache->deleteScript(it.key()); | ||
| 4354 | connect(it.value(), SIGNAL(finished(const QString&)), SLOT(loadScript(const QString&))); | 4357 | connect(it.value(), SIGNAL(finished(const QString&)), SLOT(loadScript(const QString&))); |
| 4355 | } | 4358 | } |
| 4356 | it.value()->stop(); | 4359 | it.value()->stop(); |