]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/main.cpp
wxPostScriptPrinter needs wxGenericPrintDialog but it wasn't being
[wxWidgets.git] / src / msw / main.cpp
index 5617b1f15caa3ae57d0da7ee14457a0aeee6463b..1fd175519fe3a3882b5c236c4b5695d110af22b1 100644 (file)
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation
 #endif
 
@@ -55,9 +55,6 @@
 // function prototypes
 // ----------------------------------------------------------------------------
 
-// from src/msw/app.cpp
-extern void WXDLLEXPORT wxEntryCleanup();
-
 static wxChar **ConvertToStandardCommandArgs(const wxChar *p, int& argc);
 
 // ============================================================================
@@ -172,7 +169,9 @@ wxChar **ConvertToStandardCommandArgs(const wxChar *p, int& argc)
     // and +1 here for the terminating NULL
     wxChar **argv = new wxChar *[argc + 1];
 
-    argv[0] = new wxChar[MAX_PATH];
+    // as we use wxStrdup below we must allocate the first argument using
+    // malloc(), not new[], as well
+    argv[0] = (wxChar *)malloc(MAX_PATH * sizeof(wxChar));
     ::GetModuleFileName(wxhInstance, argv[0], MAX_PATH);
 
     // copy all the other arguments to wxApp::argv[]