Revert "Fix for hanging on quit", replacing it with improved code

This commit is contained in:
Andrew Alderwick 2022-06-03 22:41:25 +01:00
parent 17fd40af43
commit eb8c496feb
1 changed files with 6 additions and 1 deletions

View File

@ -511,7 +511,12 @@ main(int argc, char **argv)
if(!loaded && !start(&u, "launcher.rom"))
return error("usage", "uxnemu [-s scale] file.rom");
run(&u);
SDL_WaitThread(stdin_thread, NULL);
#ifdef _WIN32
#pragma GCC diagnostic ignored "-Wint-to-pointer-cast"
TerminateThread((HANDLE)SDL_GetThreadID(stdin_thread), 0);
#elif !defined(__APPLE__)
close(0); /* make stdin thread exit */
#endif
SDL_Quit();
return 0;
}