From eae593b1f58dd0335ac0a1b8de5d4a4bb82c4909 Mon Sep 17 00:00:00 2001
From: Christoph Oelckers <coelckers@users.noreply.github.com>
Date: Tue, 1 Oct 2019 00:44:28 +0200
Subject: [PATCH] - put SDL_Quit into the atexit queue instead of atterm

System exit procedures should not go in there.
---
 src/posix/sdl/i_main.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/posix/sdl/i_main.cpp b/src/posix/sdl/i_main.cpp
index 5720942171..d5a5c68b18 100644
--- a/src/posix/sdl/i_main.cpp
+++ b/src/posix/sdl/i_main.cpp
@@ -179,7 +179,7 @@ int main (int argc, char **argv)
 		fprintf (stderr, "Could not initialize SDL:\n%s\n", SDL_GetError());
 		return -1;
 	}
-	atterm (SDL_Quit);
+	atexit (SDL_Quit);	// This one should NOT be in the engine's list of exit handlers!
 
 	printf("\n");