]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed Unicode compilation and run-time problems
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 1 Jul 2003 00:29:47 +0000 (00:29 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 1 Jul 2003 00:29:47 +0000 (00:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21542 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/init.cpp

index 69dadc09e04de1bccd08887694aaf6944df16612..14d60569292511b2f65d035f2bf02436e8855408 100644 (file)
@@ -141,7 +141,7 @@ static struct InitData
     // 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
-    wchar_t *argv;
+    wchar_t **argv;
 #endif // wxUSE_UNICODE
 } gs_initData;
 
@@ -168,9 +168,15 @@ static void ConvertArgsToUnicode(int argc, char **argv)
 
 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;
     }
 }