History

cleanup comments

Brad Hefta-Gaub committed 11 years ago

Commit 016a5e51 parent 41caa361 file · +2 −3Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+2−3
@@ -107,7 +107,6 @@ ScriptEngine::ScriptEngine(const QString& scriptContents, const QString& fileNam · 106 unmodified lines
107107 }
108108
109109 ScriptEngine::~ScriptEngine() {
110− qDebug() << "ScriptEngine::~ScriptEngine().... this:" << this << "my thread:" << thread();
111110 // If we're not already in the middle of stopping all scripts, then we should remove ourselves
112111 // from the list of running scripts. We don't do this if we're in the process of stopping all scripts
113112 // because that method removes scripts from its list as it iterates them
@@ -119,7 +118,7 @@ ScriptEngine::~ScriptEngine() { · 5 unmodified lines
119118 }
120119
121120 void ScriptEngine::runInThread() {
122− QThread* workerThread = new QThread(); // thread is owned but ScriptEngine, so if the ScriptEngine is destroyed, the thread will be too.
121+ QThread* workerThread = new QThread(); // thread is not owned, so we need to manage the delete
123122 QString scriptEngineName = QString("Script Thread:") + getFilename();
124123 workerThread->setObjectName(scriptEngineName);
125124
@@ -132,7 +131,7 @@ void ScriptEngine::runInThread() { · 6 unmodified lines
132131 // when the thread is finished, add thread to the deleteLater queue
133132 connect(workerThread, &QThread::finished, workerThread, &QThread::deleteLater);
134133
135− // when the thread is destroyed, add scriptEngine to the deleteLater queue
134+ // when the thread is finished, add scriptEngine to the deleteLater queue
136135 connect(workerThread, &QThread::finished, this, &ScriptEngine::deleteLater);
137136
138137 moveToThread(workerThread);