By bdonner
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36939
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void wxThreadInternal::Cleanup(wxThread *thread)
{
+ if (pthread_getspecific(gs_keySelf) == 0) return;
{
wxCriticalSectionLocker lock(thread->m_critsect);
if ( thread->m_internal->GetState() == STATE_EXITED )
// 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
{