gs_initData.argv[i] = wxStrdup(wxConvLocal.cMB2WX(argv[i]));
}
+ gs_initData.argc = argc;
gs_initData.argv[argc] = NULL;
}
delete [] gs_initData.argv;
gs_initData.argv = NULL;
+ gs_initData.argc = 0;
}
}
// clean up
// ----------------------------------------------------------------------------
-// cleanup done before destroying wxTheApp
+// cleanup done before destroying wxTheApp
static void DoCommonPreCleanup()
{
#if wxUSE_LOG
// flush the logged messages if any and install a 'safer' log target: the
// default one (wxLogGui) can't be used after the resources are freed just
// below and the user supplied one might be even more unsafe (using any
- // wxWindows GUI function is unsafe starting from now)
+ // wxWidgets GUI function is unsafe starting from now)
wxLog::DontCreateOnDemand();
// this will flush the old messages if any
delete wxLog::SetActiveTarget(new wxLogStderr);
#endif // wxUSE_LOG
-
- wxModule::CleanUpModules();
}
// cleanup done after destroying wxTheApp
static void DoCommonPostCleanup()
{
+ wxModule::CleanUpModules();
+
wxClassInfo::CleanUp();
// we can't do this in wxApp itself because it doesn't know if argv had
// wxEntry
// ----------------------------------------------------------------------------
+// for MSW with wxUSE_ON_FATAL_EXCEPTION on, wxEntry is defined in msw/main.cpp
#if !defined(__WXMSW__) || !wxUSE_ON_FATAL_EXCEPTION
#define wxEntryReal wxEntry
#endif // !(__WXMSW__ && wxUSE_ON_FATAL_EXCEPTION)
wxCATCH_ALL( wxTheApp->OnUnhandledException(); return -1; )
}
-// wrap real wxEntry in a try-except block to be able to call
-// OnFatalException() if necessary
-#if defined(__WXMSW__) && wxUSE_ON_FATAL_EXCEPTION
-
-#ifdef __WXWINCE__
-// For ExitThread
-#include "wx/msw/private.h"
-#endif
-
-extern unsigned long wxGlobalSEHandler(EXCEPTION_POINTERS *pExcPtrs);
-
-int wxEntry(int& argc, wxChar **argv)
-{
- __try
- {
- return wxEntryReal(argc, argv);
- }
- __except ( wxGlobalSEHandler(GetExceptionInformation()) )
- {
-#ifdef __WXWINCE__
- ::ExitThread(3); // the same exit code as abort()
-#else
- ::ExitProcess(3); // the same exit code as abort()
-#endif
-
-#if !defined(_MSC_VER) || _MSC_VER < 1300
- // this code is unreachable but put it here to suppress warnings
- // from some compilers
- return -1;
-#endif
- }
-}
-
-#endif // __WXMSW__ && wxUSE_ON_FATAL_EXCEPTION
-
#if wxUSE_UNICODE
// as with wxEntryStart, we provide an ANSI wrapper