#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"
return m_traits;
}
+/* static */
+wxAppTraits *wxAppConsoleBase::GetTraitsIfExists()
+{
+ wxAppConsole * const app = GetInstance();
+ return app ? app->GetTraits() : NULL;
+}
+
// ----------------------------------------------------------------------------
// event processing
// ----------------------------------------------------------------------------
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