mirror of
https://github.com/overte-org/overte.git
synced 2025-08-11 00:28:40 +02:00
cleanup comments
This commit is contained in:
parent
41caa36038
commit
016a5e5f0a
1 changed files with 2 additions and 3 deletions
|
@ -107,7 +107,6 @@ ScriptEngine::ScriptEngine(const QString& scriptContents, const QString& fileNam
|
||||||
}
|
}
|
||||||
|
|
||||||
ScriptEngine::~ScriptEngine() {
|
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
|
// 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
|
// 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
|
// because that method removes scripts from its list as it iterates them
|
||||||
|
@ -119,7 +118,7 @@ ScriptEngine::~ScriptEngine() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptEngine::runInThread() {
|
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();
|
QString scriptEngineName = QString("Script Thread:") + getFilename();
|
||||||
workerThread->setObjectName(scriptEngineName);
|
workerThread->setObjectName(scriptEngineName);
|
||||||
|
|
||||||
|
@ -132,7 +131,7 @@ void ScriptEngine::runInThread() {
|
||||||
// when the thread is finished, add thread to the deleteLater queue
|
// when the thread is finished, add thread to the deleteLater queue
|
||||||
connect(workerThread, &QThread::finished, workerThread, &QThread::deleteLater);
|
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);
|
connect(workerThread, &QThread::finished, this, &ScriptEngine::deleteLater);
|
||||||
|
|
||||||
moveToThread(workerThread);
|
moveToThread(workerThread);
|
||||||
|
|
Loading…
Reference in a new issue