#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"
// initilization/cleanup
// ----------------------------------------------------------------------------
-bool wxAppConsoleBase::Initialize(int& WXUNUSED(argc), wxChar **WXUNUSED(argv))
+bool wxAppConsoleBase::Initialize(int& WXUNUSED(argc), wxChar **argv)
{
#if wxUSE_INTL
GetTraits()->SetLocale();
#endif
#ifndef __WXPALMOS__
- if ( m_appName.empty() && argv )
+ if ( m_appName.empty() && argv && argv[0] )
{
// the application name is, by default, the name of its executable file
wxFileName::SplitPath(argv[0], NULL, &m_appName, NULL);
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