run SDL_Quit() at exit

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1125 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2014-10-18 11:20:14 +00:00
parent 42def503ff
commit ce78a2ea51

View file

@ -54,7 +54,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#endif #endif
static void Sys_CheckSDL (void) static void Sys_AtExit (void)
{
SDL_Quit();
}
static void Sys_InitSDL (void)
{ {
#if defined(USE_SDL2) #if defined(USE_SDL2)
SDL_version v; SDL_version v;
@ -74,6 +79,12 @@ static void Sys_CheckSDL (void)
Sys_Error("Your version of SDL library is incompatible with me.\n" Sys_Error("Your version of SDL library is incompatible with me.\n"
"You need a library version in the line of %d.%d.%d\n", SDL_MIN_X,SDL_MIN_Y,SDL_MIN_Z); "You need a library version in the line of %d.%d.%d\n", SDL_MIN_X,SDL_MIN_Y,SDL_MIN_Z);
} }
if (SDL_Init(0) < 0)
{
Sys_Error("SDL failed to initialize.");
}
atexit(Sys_AtExit);
} }
#if defined(_LP64) || defined(__LP64__) || defined(_WIN64) #if defined(_LP64) || defined(__LP64__) || defined(_WIN64)
@ -105,7 +116,7 @@ int main(int argc, char *argv[])
isDedicated = (COM_CheckParm("-dedicated") != 0); isDedicated = (COM_CheckParm("-dedicated") != 0);
Sys_CheckSDL (); Sys_InitSDL ();
Sys_Init(); Sys_Init();