Don't race to a double-delete, LambdaThread deletes its own thread

This commit is contained in:
baldurk
2016-10-05 16:51:43 +02:00
parent 044c16a0a3
commit 3ea107fd6c
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -230,6 +230,7 @@ public slots:
m_Thread->quit();
deleteLater();
m_Thread->deleteLater();
m_Thread = NULL;
}
public:
@@ -242,7 +243,7 @@ public:
}
void start(QThread::Priority prio = QThread::InheritPriority) { m_Thread->start(prio); }
bool isRunning() { return m_Thread->isRunning(); }
bool isRunning() { return m_Thread && m_Thread->isRunning(); }
};
// helper for doing a manual blocking invoke of a dialog
+1 -1
View File
@@ -94,7 +94,7 @@ void RenderManager::CloseThread()
{
}
m_Thread->deleteLater();
// the thread deletes itself, don't delete here
m_Thread = NULL;
}