# Conflicts: # libraries/image/src/image/Image.h
Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 267 files). Show all
Unified · Split
| @@ -163,7 +163,7 @@ ScriptEnginePointer scriptEngineFactory(ScriptEngine::Context context, · 162 unmodified lines | |||
| 163 | const QString& scriptContents, | 163 | const QString& scriptContents, |
| 164 | const QString& fileNameString) { | 164 | const QString& fileNameString) { |
| 165 | ScriptEngine* engine = new ScriptEngine(context, scriptContents, fileNameString); | 165 | ScriptEngine* engine = new ScriptEngine(context, scriptContents, fileNameString); |
| 166 | ScriptEnginePointer engineSP = ScriptEnginePointer(engine); | 166 | ScriptEnginePointer engineSP = ScriptEnginePointer(engine, &QObject::deleteLater); |
| 167 | auto scriptEngines = DependencyManager::get<ScriptEngines>(); | 167 | auto scriptEngines = DependencyManager::get<ScriptEngines>(); |
| 168 | scriptEngines->addScriptEngine(qSharedPointerCast<ScriptEngine>(engineSP)); | 168 | scriptEngines->addScriptEngine(qSharedPointerCast<ScriptEngine>(engineSP)); |
| 169 | engine->setScriptEngines(scriptEngines); | 169 | engine->setScriptEngines(scriptEngines); |
| @@ -267,7 +267,7 @@ void ScriptEngine::disconnectNonEssentialSignals() { · 97 unmodified lines | |||
| 267 | QThread* workerThread; | 267 | QThread* workerThread; |
| 268 | // Ensure the thread should be running, and does exist | 268 | // Ensure the thread should be running, and does exist |
| 269 | if (_isRunning && _isThreaded && (workerThread = thread())) { | 269 | if (_isRunning && _isThreaded && (workerThread = thread())) { |
| 270 | connect(this, &ScriptEngine::doneRunning, workerThread, &QThread::quit); | 270 | connect(this, &QObject::destroyed, workerThread, &QThread::quit); |
| 271 | connect(workerThread, &QThread::finished, workerThread, &QObject::deleteLater); | 271 | connect(workerThread, &QThread::finished, workerThread, &QObject::deleteLater); |
| 272 | } | 272 | } |
| 273 | } | 273 | } |
| @@ -381,7 +381,7 @@ void ScriptEngine::runInThread() { · 107 unmodified lines | |||
| 381 | // the script engine, make sure to add code to "reconnect" them to the | 381 | // the script engine, make sure to add code to "reconnect" them to the |
| 382 | // disconnectNonEssentialSignals() method | 382 | // disconnectNonEssentialSignals() method |
| 383 | connect(workerThread, &QThread::started, this, &ScriptEngine::run); | 383 | connect(workerThread, &QThread::started, this, &ScriptEngine::run); |
| 384 | connect(this, &ScriptEngine::doneRunning, workerThread, &QThread::quit); | 384 | connect(this, &QObject::destroyed, workerThread, &QThread::quit); |
| 385 | connect(workerThread, &QThread::finished, workerThread, &QObject::deleteLater); | 385 | connect(workerThread, &QThread::finished, workerThread, &QObject::deleteLater); |
| 386 | 386 | ||
| 387 | workerThread->start(); | 387 | workerThread->start(); |