X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e2450fa9b43028abdc42accf3f5ba2b23106e546..878711c01c1b9ad5b97d35f379a048b8ce1bfb49:/src/common/init.cpp?ds=inline diff --git a/src/common/init.cpp b/src/common/init.cpp index 527e5ca42d..4f0aed6e49 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -49,7 +49,6 @@ class /* no WXDLLEXPORT */ wxConsoleApp : public wxApp { public: virtual int OnRun() { wxFAIL_MSG(wxT("unreachable")); return 0; } - virtual bool ProcessIdle() { return TRUE; } }; // ---------------------------------------------------------------------------- @@ -111,7 +110,6 @@ bool WXDLLEXPORT wxInitialize() return FALSE; } - wxTheApp->CreateMessageOutput(); gs_nInitCount++; return TRUE; @@ -151,18 +149,16 @@ int wxEntry(int argc, char **argv) #if wxUSE_UNICODE wxTheApp->argv = new wxChar*[argc+1]; - int mb_argc = 0; - while (mb_argc < argc) + for ( int mb_argc = 0; mb_argc < argc; mb_argc++ ) { wxTheApp->argv[mb_argc] = wxStrdup(wxConvLocal.cMB2WX(argv[mb_argc])); - mb_argc++; } wxTheApp->argv[mb_argc] = (wxChar *)NULL; #else wxTheApp->argv = argv; #endif - wxString name = wxFileNameFromPath(argv[0]); + wxString name = wxFileNameFromPath(wxTheApp->argv[0]); wxStripExtension(name); wxTheApp->SetAppName(name); @@ -223,6 +219,14 @@ static void DoCleanUp() 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; @@ -233,4 +237,3 @@ static void DoCleanUp() #endif // wxUSE_LOG } -// vi:sts=4:sw=4:et