mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
assert: Use TerminateProcess() on Windows, vs ExitProcess (thanks, Jack!).
"What I have done is use TerminateProcess rather than ExitProcess. ExitProcess will cause Microsoft's leak detection to continue, TerminateProcess won't. It is also technically wrong to use ExitProcess in the case of aborting the application. Jack Powell Twitter @jack9267"
This commit is contained in:
parent
99683f7c04
commit
8536130aa2
@ -123,7 +123,11 @@ static void SDL_GenerateAssertionReport(void)
|
|||||||
static SDL_NORETURN void SDL_ExitProcess(int exitcode)
|
static SDL_NORETURN void SDL_ExitProcess(int exitcode)
|
||||||
{
|
{
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
ExitProcess(exitcode);
|
/* "if you do not know the state of all threads in your process, it is
|
||||||
|
better to call TerminateProcess than ExitProcess"
|
||||||
|
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682658(v=vs.85).aspx */
|
||||||
|
TerminateProcess(GetCurrentProcess(), exitcode);
|
||||||
|
|
||||||
#elif defined(__EMSCRIPTEN__)
|
#elif defined(__EMSCRIPTEN__)
|
||||||
emscripten_cancel_main_loop(); /* this should "kill" the app. */
|
emscripten_cancel_main_loop(); /* this should "kill" the app. */
|
||||||
emscripten_force_exit(exitcode); /* this should "kill" the app. */
|
emscripten_force_exit(exitcode); /* this should "kill" the app. */
|
||||||
|
Loading…
Reference in New Issue
Block a user