git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21542
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// them to Unicode ourselves (this is the case under Unix but not Windows,
// for example), we remember the converted argv here because we'll have to
// free it when doing cleanup to avoid memory leaks
// them to Unicode ourselves (this is the case under Unix but not Windows,
// for example), we remember the converted argv here because we'll have to
// free it when doing cleanup to avoid memory leaks
#endif // wxUSE_UNICODE
} gs_initData;
#endif // wxUSE_UNICODE
} gs_initData;
static void FreeConvertedArgs()
{
static void FreeConvertedArgs()
{
- for ( int mb_argc = 0; mb_argc < wxTheApp->argc; mb_argc++ )
+ if ( gs_initData.argv )
- free(wxTheApp->argv[mb_argc]);
+ for ( int i = 0; i < gs_initData.argc; i++ )
+ {
+ free(gs_initData.argv[i]);
+ }
+
+ delete [] gs_initData.argv;
+ gs_initData.argv = NULL;