From 08a66abde9f9e10ac741c7c1bfb446b715371320 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 11 Oct 2019 11:56:38 +0300 Subject: [PATCH] - call SDL_Quit() from main() instead of atexit() This should help with crash reporting during SDL shutdown --- src/posix/sdl/i_main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/posix/sdl/i_main.cpp b/src/posix/sdl/i_main.cpp index c4f251499..b6fe55e45 100644 --- a/src/posix/sdl/i_main.cpp +++ b/src/posix/sdl/i_main.cpp @@ -173,7 +173,6 @@ int main (int argc, char **argv) fprintf (stderr, "Could not initialize SDL:\n%s\n", SDL_GetError()); return -1; } - atexit (SDL_Quit); // This one should NOT be in the engine's list of exit handlers! printf("\n"); @@ -195,5 +194,10 @@ int main (int argc, char **argv) } I_StartupJoysticks(); - return D_DoomMain (); + + const int result = D_DoomMain(); + + SDL_Quit(); + + return result; }