Fixed crash running SDL test programs on UWP

This commit is contained in:
Sam Lantinga 2021-11-27 09:36:44 -08:00
parent 5a0ea7fb17
commit e04a0221e3

View File

@ -357,9 +357,16 @@ void SDL_WinRTApp::Run()
{ {
// TODO, WinRT: pass the C-style main() a reasonably realistic // TODO, WinRT: pass the C-style main() a reasonably realistic
// representation of command line arguments. // representation of command line arguments.
int argc = 0; int argc = 1;
char **argv = NULL; char **argv = (char **)SDL_malloc(2 * sizeof(*argv));
if (!argv) {
return;
}
argv[0] = SDL_strdup("WinRTApp");
argv[1] = NULL;
WINRT_SDLAppEntryPoint(argc, argv); WINRT_SDLAppEntryPoint(argc, argv);
SDL_free(argv[0]);
SDL_free(argv);
} }
} }