diff --git a/libraries/shared/src/GenericThread.cpp b/libraries/shared/src/GenericThread.cpp index a2dcf1004d..186366c606 100644 --- a/libraries/shared/src/GenericThread.cpp +++ b/libraries/shared/src/GenericThread.cpp @@ -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; } } }