#include "wx/app.h"
#include "wx/debug.h"
#include "wx/filefn.h"
+ #include "wx/log.h"
#endif
#include "wx/module.h"
return FALSE;
}
- wxTheApp->DoInit();
gs_nInitCount++;
return TRUE;
#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(wxConvLibc.cMB2WX(argv[mb_argc]));
- mb_argc++;
+ wxTheApp->argv[mb_argc] = wxStrdup(wxConvLocal.cMB2WX(argv[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);
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;
delete wxLog::SetActiveTarget(NULL);
#endif // wxUSE_LOG
}
+