From: Robert Roebling Date: Mon, 31 Jan 2005 17:55:20 +0000 (+0000) Subject: Set state of internal thread object upon ::Exit X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/343b1669f3be8bf4bee70e4f966256972b380d26 Set state of internal thread object upon ::Exit to EXITED. This is consistent with MSW and fixes a crash with double deletion. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31672 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index 3da088548d..8365dfc5eb 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -1483,6 +1483,12 @@ void wxThread::Exit(ExitCode status) // only call one thread function at a time :-( DeleteThread(this); } + else + { + m_critsect.Enter(); + m_internal->SetState(STATE_EXITED); + m_critsect.Leave(); + } // terminate the thread (pthread_exit() never returns) pthread_exit(status);