mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Merge pull request #1664 from ZappoMan/bugfixes
fix random crash on interface shutdown
This commit is contained in:
commit
000bbccdf0
1 changed files with 5 additions and 1 deletions
|
@ -20,7 +20,10 @@ GenericThread::GenericThread() :
|
|||
}
|
||||
|
||||
GenericThread::~GenericThread() {
|
||||
terminate();
|
||||
// we only need to call terminate() if we're actually threaded and still running
|
||||
if (isStillRunning() && isThreaded()) {
|
||||
terminate();
|
||||
}
|
||||
}
|
||||
|
||||
void GenericThread::initialize(bool isThreaded) {
|
||||
|
@ -45,6 +48,7 @@ void GenericThread::terminate() {
|
|||
if (_thread) {
|
||||
_thread->wait();
|
||||
_thread->deleteLater();
|
||||
_thread = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue