diff --git a/lib/tinythread.cpp b/lib/tinythread.cpp index fed3b63f..5d17de4a 100644 --- a/lib/tinythread.cpp +++ b/lib/tinythread.cpp @@ -169,8 +169,10 @@ namespace tthread { // The thread is no longer executing if (ti->mThread) { lock_guard guard(ti->mThread->mDataMutex); - ti->mThread->mNotAThread = true; - ti->mThread->ti_copy = 0; + if (ti->mThread){ + ti->mThread->mNotAThread = true; + ti->mThread->ti_copy = 0; + } } // The thread is responsible for freeing the startup information