+void wxThreadSpecificInfo::ThreadCleanUp()
+{
+ if ( !wxTLS_VALUE(g_thisThreadInfo) )
+ return; // nothing to do, not used by this thread at all
+
+ // find this thread's instance in g_allThreadInfos and destroy it
+ wxCriticalSectionLocker lock(g_csAllThreadInfos);
+ for ( wxAllThreadInfos::iterator i = g_allThreadInfos.begin();
+ i != g_allThreadInfos.end();
+ ++i )
+ {
+ if ( i->get() == wxTLS_VALUE(g_thisThreadInfo) )
+ {
+ g_allThreadInfos.erase(i);
+ wxTLS_VALUE(g_thisThreadInfo) = NULL;
+ break;
+ }
+ }
+}
+