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
1 changed files with 9 additions and 2 deletions

View File

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