Fixed a mess in win.c that was causing a corruption of the command lime parameters array.

This commit is contained in:
OBattler
2020-01-17 05:44:38 +01:00
parent 124347b72a
commit 7bef50b782

View File

@@ -73,6 +73,7 @@ static rc_str_t *lpRCstr2048,
*lpRCstr6144, *lpRCstr6144,
*lpRCstr7168; *lpRCstr7168;
static int vid_api_inited = 0; static int vid_api_inited = 0;
static wchar_t *argbuf;
static const struct { static const struct {
@@ -280,7 +281,6 @@ static int
ProcessCommandLine(wchar_t ***argw) ProcessCommandLine(wchar_t ***argw)
{ {
WCHAR *cmdline; WCHAR *cmdline;
wchar_t *argbuf;
wchar_t **args; wchar_t **args;
int argc_max; int argc_max;
int i, q, argc; int i, q, argc;
@@ -336,8 +336,6 @@ ProcessCommandLine(wchar_t ***argw)
args[argc] = NULL; args[argc] = NULL;
*argw = args; *argw = args;
free(argbuf);
return(argc); return(argc);
} }
@@ -383,6 +381,7 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
if (source_hwnd) if (source_hwnd)
PostMessage((HWND) (uintptr_t) source_hwnd, WM_HAS_SHUTDOWN, (WPARAM) 0, (LPARAM) hwndMain); PostMessage((HWND) (uintptr_t) source_hwnd, WM_HAS_SHUTDOWN, (WPARAM) 0, (LPARAM) hwndMain);
free(argbuf);
free(argw); free(argw);
return(1); return(1);
} }
@@ -394,6 +393,7 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow)
/* Handle our GUI. */ /* Handle our GUI. */
i = ui_init(nCmdShow); i = ui_init(nCmdShow);
free(argbuf);
free(argw); free(argw);
return(i); return(i);
} }