Showing the changes to libraries/script-engine/src/ScriptEngines.cpp (1 of 3 files). Show all
Unified · Split
| @@ -112,6 +112,8 @@ void ScriptEngines::shutdownScripting() { · 111 unmodified lines | ||
| 112 | 112 | scriptEngine->waitTillDoneRunning(); |
| 113 | 113 | qCDebug(scriptengine) << "done waiting on script:" << scriptName; |
| 114 | 114 | |
| 115 | + scriptEngine->deleteLater(); | |
| 116 | + | |
| 115 | 117 | // If the script is stopped, we can remove it from our set |
| 116 | 118 | i.remove(); |
| 117 | 119 | } |
| @@ -343,6 +345,10 @@ ScriptEngine* ScriptEngines::loadScript(const QString& scriptFilename, bool isUs · 225 unmodified lines | ||
| 343 | 345 | |
| 344 | 346 | scriptEngine = new ScriptEngine(NO_SCRIPT, "", true); |
| 345 | 347 | scriptEngine->setUserLoaded(isUserLoaded); |
| 348 | + connect(scriptEngine, &ScriptEngine::doneRunning, this, [scriptEngine] { | |
| 349 | + scriptEngine->deleteLater(); | |
| 350 | + }, Qt::QueuedConnection); | |
| 351 | + | |
| 346 | 352 | |
| 347 | 353 | if (scriptFilename.isNull()) { |
| 348 | 354 | launchScriptEngine(scriptEngine); |
| @@ -431,5 +437,8 @@ QString ScriptEngines::getPreviousScriptLocation() const { · 82 unmodified lines | ||
| 431 | 437 | } |
| 432 | 438 | |
| 433 | 439 | void ScriptEngines::setPreviousScriptLocation(const QString& previousScriptLocation) { |
| 434 | − _previousScriptLocation.set(previousScriptLocation); | |
| 440 | + if (_previousScriptLocation.get() != previousScriptLocation) { | |
| 441 | + _previousScriptLocation.set(previousScriptLocation); | |
| 442 | + emit previousScriptLocationChanged(); | |
| 443 | + } | |
| 435 | 444 | } |