We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d23d76 commit 722f989Copy full SHA for 722f989
mono/metadata/threads.c
@@ -1036,12 +1036,17 @@ void ves_icall_System_Threading_InternalThread_Thread_free_internal (MonoInterna
1036
CloseHandle (thread);
1037
1038
if (this->synch_cs) {
1039
- DeleteCriticalSection (this->synch_cs);
1040
- g_free (this->synch_cs);
+ CRITICAL_SECTION *synch_cs = this->synch_cs;
1041
this->synch_cs = NULL;
+ DeleteCriticalSection (synch_cs);
1042
+ g_free (synch_cs);
1043
}
1044
- g_free (this->name);
1045
+ if (this->name) {
1046
+ void *name = this->name;
1047
+ this->name = NULL;
1048
+ g_free (name);
1049
+ }
1050
1051
1052
static void mono_thread_start (MonoThread *thread)
0 commit comments