Use atexit(SDL_Quit) idiom. XCloseDisplay() only when using X11 graphics.

This commit is contained in:
gbeauche 2004-06-24 15:18:42 +00:00
parent 14587bed4d
commit 8948ce2a49

View File

@ -401,6 +401,7 @@ int main(int argc, char **argv)
ErrorAlert(str);
QuitEmulator();
}
atexit(SDL_Quit);
#endif
// Init system routines
@ -784,11 +785,8 @@ void QuitEmulator(void)
// Exit preferences
PrefsExit();
#ifdef USE_SDL
// Exit SDL system
SDL_Quit();
#else
// Close X11 server connection
#ifndef USE_SDL_VIDEO
if (x_display)
XCloseDisplay(x_display);
#endif