X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..d6fd667bc19986e20f7ca33976061d57d89bc41c:/src/mac/carbon/thread.cpp diff --git a/src/mac/carbon/thread.cpp b/src/mac/carbon/thread.cpp index ad7f278ff9..84de36ee2b 100644 --- a/src/mac/carbon/thread.cpp +++ b/src/mac/carbon/thread.cpp @@ -7,7 +7,7 @@ // RCS-ID: $Id$ // Copyright: (c) Wolfram Gloger (1996, 1997); Guilhem Lavaux (1998), // Vadim Zeitlin (1999) , Stefan Csomor (2000) -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -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;