From b4866582826131342dd610fab2136df84f8fb974 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 17 Jan 2006 19:17:40 +0000 Subject: [PATCH] Applied patch [ 1336712 ] Fix segfault when calling wxThread::Exit() By bdonner git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36939 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/unix/threadpsx.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index 2eb63474f9..d1a8b82f60 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -818,6 +818,7 @@ extern "C" void wxPthreadCleanup(void *ptr) void wxThreadInternal::Cleanup(wxThread *thread) { + if (pthread_getspecific(gs_keySelf) == 0) return; { wxCriticalSectionLocker lock(thread->m_critsect); if ( thread->m_internal->GetState() == STATE_EXITED ) @@ -1481,6 +1482,7 @@ void wxThread::Exit(ExitCode status) // we make it a global object, but this would mean that we can // only call one thread function at a time :-( DeleteThread(this); + pthread_setspecific(gs_keySelf, 0); } else { -- 2.45.2