-// This is set within wxEntryStart -- too early on
-// to put these in wxTheApp
-static int g_newArgc = 0;
-static wxChar** g_newArgv = NULL;
-static bool g_showIconic = FALSE;
-static wxSize g_initialSize = wxDefaultSize;
-
-bool wxApp::Initialize()
-{
- wxClassInfo::InitializeClasses();
-
- // GL: I'm annoyed ... I don't know where to put this and I don't want to
- // create a module for that as it's part of the core.
-#if wxUSE_THREADS
- wxPendingEventsLocker = new wxCriticalSection();
-#endif
-
- wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING);
- wxTheColourDatabase->Initialize();
-
- wxInitializeStockLists();
- wxInitializeStockObjects();
-
-#if wxUSE_WX_RESOURCES
- wxInitializeResourceSystem();
-#endif
-
- wxWidgetHashTable = new wxHashTable(wxKEY_INTEGER);
-
- wxModule::RegisterModules();
- if (!wxModule::InitializeModules()) return FALSE;
-
- return TRUE;
-}
-
-void wxApp::CleanUp()
-{
- if (g_newArgv)
- delete[] g_newArgv;
- g_newArgv = NULL;
-
- delete wxWidgetHashTable;
- wxWidgetHashTable = NULL;
-
- wxModule::CleanUpModules();
-
-#if wxUSE_WX_RESOURCES
- wxCleanUpResourceSystem();
-#endif
-
- delete wxTheColourDatabase;
- wxTheColourDatabase = NULL;
-
- wxDeleteStockObjects();
-
- wxDeleteStockLists();
-
- delete wxTheApp;
- wxTheApp = NULL;
-
- wxClassInfo::CleanUpClasses();
-
-#if wxUSE_THREADS
- delete wxPendingEvents;
- delete wxPendingEventsLocker;
-#endif
-
-#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
- // At this point we want to check if there are any memory
- // blocks that aren't part of the wxDebugContext itself,
- // as a special case. Then when dumping we need to ignore
- // wxDebugContext, too.
- if (wxDebugContext::CountObjectsLeft(TRUE) > 0)
- {
- wxLogDebug("There were memory leaks.");
- wxDebugContext::Dump();
- wxDebugContext::PrintStatistics();
- }
-#endif