#include "wx/module.h"
-// ----------------------------------------------------------------------------
-// global vars
-// ----------------------------------------------------------------------------
-
-WXDLLEXPORT wxApp *wxTheApp = NULL;
-
-wxAppInitializerFunction
- wxAppBase::m_appInitFn = (wxAppInitializerFunction)NULL;
-
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
-class /* no WXDLLEXPORT */ wxConsoleApp : public wxApp
+// we need a dummy app object if the user doesn't want to create a real one
+class wxDummyConsoleApp : public wxApp
{
public:
- virtual int OnRun() { wxFAIL_MSG(wxT("unreachable")); return 0; }
+ virtual int OnRun() { wxFAIL_MSG( _T("unreachable code") ); return 0; }
};
// ----------------------------------------------------------------------------
// implementation
// ============================================================================
-// ----------------------------------------------------------------------------
-// stubs for some GUI functions
-// ----------------------------------------------------------------------------
-
-void WXDLLEXPORT wxExit()
-{
- abort();
-}
-
-// Yield to other apps/messages
-void WXDLLEXPORT wxWakeUpIdle()
-{
- // do nothing
-}
-
// ----------------------------------------------------------------------------
// wxBase-specific functions
// ----------------------------------------------------------------------------
return FALSE;
}
- wxTheApp = new wxConsoleApp;
+ wxTheApp = new wxDummyConsoleApp;
if ( !wxTheApp )
{
wxClassInfo::CleanUpClasses();
+ // TODO: this should really be done in ~wxApp
+#if wxUSE_UNICODE
+ for ( int mb_argc = 0; mb_argc < wxTheApp->argc; mb_argc++ )
+ {
+ free(wxTheApp->argv[mb_argc]);
+ }
+#endif // wxUSE_UNICODE
+
// delete the application object
delete wxTheApp;
wxTheApp = (wxApp *)NULL;