]> git.saurik.com Git - wxWidgets.git/commitdiff
make sure we are getting the gui mutex before shutting down
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 29 May 2004 19:43:32 +0000 (19:43 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 29 May 2004 19:43:32 +0000 (19:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27506 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/thread.cpp

index f19bc74ca36a43d7a3c1e6f1fa69d44724b7d7ec..84de36ee2bf07b530835346284266f549bfda4ae 100644 (file)
@@ -1630,6 +1630,11 @@ void wxThreadModule::OnExit()
 {
     if ( gs_critsectGui )
     {
 {
     if ( gs_critsectGui )
     {
+        if ( !wxGuiOwnedByMainThread() )
+        {
+            gs_critsectGui->Enter();
+            gs_bGuiOwnedByMainThread = true;
+        }
         gs_critsectGui->Leave();
         delete gs_critsectGui;
         gs_critsectGui = NULL;
         gs_critsectGui->Leave();
         delete gs_critsectGui;
         gs_critsectGui = NULL;