Merge pull request #1664 from ZappoMan/bugfixes

fix random crash on interface shutdown
This commit is contained in:
Stephen Birarda 2014-01-23 16:25:07 -08:00
commit 000bbccdf0

View file

@ -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;
}
}
}