]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/thread.cpp
security fix to wxSingleInstanceChecker: check if the lock file was really created...
[wxWidgets.git] / src / mac / carbon / thread.cpp
index f19bc74ca36a43d7a3c1e6f1fa69d44724b7d7ec..84de36ee2bf07b530835346284266f549bfda4ae 100644 (file)
@@ -1630,6 +1630,11 @@ void wxThreadModule::OnExit()
 {
     if ( gs_critsectGui )
     {
+        if ( !wxGuiOwnedByMainThread() )
+        {
+            gs_critsectGui->Enter();
+            gs_bGuiOwnedByMainThread = true;
+        }
         gs_critsectGui->Leave();
         delete gs_critsectGui;
         gs_critsectGui = NULL;