]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/appbase.cpp
use buffered streams to reduce the number of TCP packets used per IPC command from...
[wxWidgets.git] / src / common / appbase.cpp
index 1efd57adddb6bd1cc567ed083c5a71241bc97e74..076cabb60fc2abd3222af1d82e06b436e9218f52 100644 (file)
     #include "wx/fontmap.h"
 #endif // wxUSE_FONTMAP
 
-#if defined(__DARWIN__) && defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS
-    // For MacTypes.h for Debugger function
-    #include <CoreFoundation/CFBase.h>
-#endif
-
-#if defined(__WXMAC__)
-    #ifdef __DARWIN__
-        #include  <CoreServices/CoreServices.h>
-    #else
-        #include  "wx/mac/private.h"  // includes mac headers
-    #endif
-#endif // __WXMAC__
-
 #ifdef __WXDEBUG__
     #if wxUSE_STACKWALKER
         #include "wx/stackwalk.h"
@@ -290,6 +277,13 @@ wxAppTraits *wxAppConsoleBase::GetTraits()
     return m_traits;
 }
 
+/* static */
+wxAppTraits *wxAppConsoleBase::GetTraitsIfExists()
+{
+    wxAppConsole * const app = GetInstance();
+    return app ? app->GetTraits() : NULL;
+}
+
 // ----------------------------------------------------------------------------
 // event processing
 // ----------------------------------------------------------------------------
@@ -673,12 +667,16 @@ void wxAppTraitsBase::MutexGuiLeave()
 
 void WXDLLIMPEXP_BASE wxMutexGuiEnter()
 {
-    wxAppConsoleBase::GetInstance()->GetTraits()->MutexGuiEnter();
+    wxAppTraits * const traits = wxAppConsoleBase::GetTraitsIfExists();
+    if ( traits )
+        traits->MutexGuiEnter();
 }
 
 void WXDLLIMPEXP_BASE wxMutexGuiLeave()
 {
-    wxAppConsoleBase::GetInstance()->GetTraits()->MutexGuiLeave();
+    wxAppTraits * const traits = wxAppConsoleBase::GetTraitsIfExists();
+    if ( traits )
+        traits->MutexGuiLeave();
 }
 #endif // wxUSE_THREADS