- wxModule::CleanUpModules();
-
-#if wxUSE_WX_RESOURCES
- wxCleanUpResourceSystem();
-#endif
-
- delete wxTheColourDatabase;
- wxTheColourDatabase = (wxColourDatabase*) NULL;
-
- wxDeleteStockObjects();
-
- wxDeleteStockLists();
-
- delete wxTheApp;
- wxTheApp = (wxApp*) NULL;
-
- wxClassInfo::CleanUpClasses();
-
-#if wxUSE_THREADS
- delete wxPendingEvents;
- delete wxPendingEventsLocker;
-#endif
-
- // check for memory leaks
-#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
- if (wxDebugContext::CountObjectsLeft(TRUE) > 0)
- {
- wxLogDebug(wxT("There were memory leaks.\n"));
- wxDebugContext::Dump();
- wxDebugContext::PrintStatistics();
- }
-#endif // Debug
-
-#if wxUSE_LOG
- // do this as the very last thing because everything else can log messages
- wxLog::DontCreateOnDemand();
-
- wxLog *oldLog = wxLog::SetActiveTarget( (wxLog*) NULL );
- if (oldLog)
- delete oldLog;
-#endif // wxUSE_LOG
-}
-
-//-----------------------------------------------------------------------------
-// wxEntry
-//-----------------------------------------------------------------------------
-
-// NB: argc and argv may be changed here, pass by reference!
-int wxEntryStart( int& argc, char *argv[] )
-{
-#if wxUSE_THREADS
- // GTK 1.2 up to version 1.2.3 has broken threads
- if ((gtk_major_version == 1) &&
- (gtk_minor_version == 2) &&
- (gtk_micro_version < 4))
- {
- printf( "wxWindows warning: GUI threading disabled due to outdated GTK version\n" );
- }
- else
- {
- g_thread_init(NULL);
- }
-#endif
-
- gtk_set_locale();
-
- // We should have the wxUSE_WCHAR_T test on the _outside_
-#if wxUSE_WCHAR_T
-#if defined(__WXGTK20__)
- // gtk+ 2.0 supports Unicode through UTF-8 strings
- wxConvCurrent = &wxConvUTF8;
-#else
- if (!wxOKlibc()) wxConvCurrent = &wxConvLocal;
-#endif
-#else
- if (!wxOKlibc()) wxConvCurrent = (wxMBConv*) NULL;
-#endif
-
- gdk_threads_enter();
-
- gtk_init( &argc, &argv );
-
- wxSetDetectableAutoRepeat( TRUE );
-
- if (!wxApp::Initialize())
- {
- gdk_threads_leave();
- return -1;
- }
-
- return 0;
-}
-
-
-int wxEntryInitGui()
-{
- int retValue = 0;
-
- if ( !wxTheApp->OnInitGui() )
- retValue = -1;
-
- wxGetRootWindow();