SDLApplication: fix crash in SDL_Quit on Windows by calling SDL_QuitSubSystem first with the same flags passed to SDL_Init (closes #1934)
As far as I can tell, SDL_QuitSubSystem is not required, and SDL_Quit should automatically quit each subsystem. However, this stops the crash, so maybe there's some kind of race condition that this avoids.
This commit is contained in:
@@ -25,7 +25,7 @@ namespace lime {
|
||||
|
||||
SDLApplication::SDLApplication () {
|
||||
|
||||
Uint32 initFlags = SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER | SDL_INIT_TIMER | SDL_INIT_JOYSTICK;
|
||||
initFlags = SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER | SDL_INIT_TIMER | SDL_INIT_JOYSTICK;
|
||||
#if defined(LIME_MOJOAL) || defined(LIME_OPENALSOFT)
|
||||
initFlags |= SDL_INIT_AUDIO;
|
||||
#endif
|
||||
@@ -814,6 +814,8 @@ namespace lime {
|
||||
applicationEvent.type = EXIT;
|
||||
ApplicationEvent::Dispatch (&applicationEvent);
|
||||
|
||||
SDL_QuitSubSystem (initFlags);
|
||||
|
||||
SDL_Quit ();
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace lime {
|
||||
ClipboardEvent clipboardEvent;
|
||||
Uint32 currentUpdate;
|
||||
double framePeriod;
|
||||
Uint32 initFlags;
|
||||
DropEvent dropEvent;
|
||||
GamepadEvent gamepadEvent;
|
||||
JoystickEvent joystickEvent;
|
||||
|
||||
Reference in New Issue
Block a user