Browse Source

Failure when exiting when "system required" thread was not allocated, caused by 4b389600

Source commit: 4e32679b8f1f6f8d082b87d7a169e90c1b4ffd29
Martin Prikryl 3 năm trước cách đây
mục cha
commit
6c9661a20e
1 tập tin đã thay đổi với 7 bổ sung3 xóa
  1. 7 3
      source/windows/GUITools.cpp

+ 7 - 3
source/windows/GUITools.cpp

@@ -2382,7 +2382,11 @@ void GUIFinalize()
     Thread = SystemRequiredThread;
     SystemRequiredThread = NULL;
   }
-  Thread->Terminate();
-  Thread->WaitFor();
-  delete Thread;
+
+  if (Thread != NULL)
+  {
+    Thread->Terminate();
+    Thread->WaitFor();
+    delete Thread;
+  }
 }