Browse Source

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

Source commit: 4e32679b8f1f6f8d082b87d7a169e90c1b4ffd29
Martin Prikryl 3 years ago
parent
commit
6c9661a20e
1 changed files with 7 additions and 3 deletions
  1. 7 3
      source/windows/GUITools.cpp

+ 7 - 3
source/windows/GUITools.cpp

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