X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c67daf87774c71ae9f73af9969008af220e52a11..a5e0e655cb829a0112e1eecdf9ce4bede79cae80:/src/gtk1/app.cpp diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index 8843aa8dad..d2acce935a 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -312,11 +312,7 @@ int wxEntry( int argc, char *argv[] ) #if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT -#if !defined(_WINDLL) streambuf* sBuf = new wxDebugStreamBuf; -#else - streambuf* sBuf = NULL; -#endif ostream* oStr = new ostream(sBuf) ; wxDebugContext::SetStream(oStr, sBuf); @@ -326,7 +322,7 @@ int wxEntry( int argc, char *argv[] ) { if (!wxApp::GetInitializerFunction()) { - printf( _("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") ); + printf( "wxWindows error: No initializer - use IMPLEMENT_APP macro.\n" ); return 0; } @@ -339,13 +335,21 @@ int wxEntry( int argc, char *argv[] ) if (!wxTheApp) { - printf( _("wxWindows error: wxTheApp == NULL\n") ); + printf( "wxWindows error: wxTheApp == NULL\n" ); return 0; } wxTheApp->argc = argc; wxTheApp->argv = argv; + char name[200]; + strcpy( name, argv[0] ); + strcpy( name, wxFileNameFromPath(name) ); + wxStripExtension( name ); + wxTheApp->SetAppName( name ); + + gtk_set_locale(); + gtk_init( &argc, &argv ); #ifdef USE_GDK_IMLIB @@ -382,11 +386,15 @@ int wxEntry( int argc, char *argv[] ) wxDELETE(wxTheApp); + wxLog *oldLog = wxLog::SetActiveTarget( NULL ); + if (oldLog) delete oldLog; + + wxClassInfo::CleanUpClasses(); + + delete[] wxBuffer; + #if (WXDEBUG && USE_MEMORY_TRACING) || USE_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() > 0) { wxTrace("There were memory leaks.\n"); @@ -394,6 +402,7 @@ int wxEntry( int argc, char *argv[] ) wxDebugContext::PrintStatistics(); } wxDebugContext::SetStream(NULL, NULL); + #endif return retValue;