From 016a5e5f0a0607ead6a7c4ada9be4c2f600a2240 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Tue, 15 Sep 2015 11:52:07 -0700 Subject: [PATCH] cleanup comments --- libraries/script-engine/src/ScriptEngine.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/script-engine/src/ScriptEngine.cpp b/libraries/script-engine/src/ScriptEngine.cpp index 288e60edf0..a7136edd7b 100644 --- a/libraries/script-engine/src/ScriptEngine.cpp +++ b/libraries/script-engine/src/ScriptEngine.cpp @@ -107,7 +107,6 @@ ScriptEngine::ScriptEngine(const QString& scriptContents, const QString& fileNam } ScriptEngine::~ScriptEngine() { - qDebug() << "ScriptEngine::~ScriptEngine().... this:" << this << "my thread:" << thread(); // If we're not already in the middle of stopping all scripts, then we should remove ourselves // from the list of running scripts. We don't do this if we're in the process of stopping all scripts // because that method removes scripts from its list as it iterates them @@ -119,7 +118,7 @@ ScriptEngine::~ScriptEngine() { } void ScriptEngine::runInThread() { - QThread* workerThread = new QThread(); // thread is owned but ScriptEngine, so if the ScriptEngine is destroyed, the thread will be too. + QThread* workerThread = new QThread(); // thread is not owned, so we need to manage the delete QString scriptEngineName = QString("Script Thread:") + getFilename(); workerThread->setObjectName(scriptEngineName); @@ -132,7 +131,7 @@ void ScriptEngine::runInThread() { // when the thread is finished, add thread to the deleteLater queue connect(workerThread, &QThread::finished, workerThread, &QThread::deleteLater); - // when the thread is destroyed, add scriptEngine to the deleteLater queue + // when the thread is finished, add scriptEngine to the deleteLater queue connect(workerThread, &QThread::finished, this, &ScriptEngine::deleteLater); moveToThread(workerThread);