fix sdl2 joystick events after joystick closed

See: https://bugzilla.libsdl.org/show_bug.cgi?id=4640
This commit is contained in:
Nicolas Adenis-Lamarre 2019-08-07 11:27:46 +01:00 committed by Conn O'Griofa
parent 65b77e23ab
commit 57b95ddd3b

View file

@ -1047,7 +1047,7 @@ SDL_JoystickUpdate(void)
if (joystick->delayed_guide_button) {
SDL_GameControllerHandleDelayedGuideButton(joystick);
}
}
if (joystick->force_recentering) {
/* Tell the app that everything is centered/unpressed... */
@ -1067,6 +1067,8 @@ SDL_JoystickUpdate(void)
joystick->force_recentering = SDL_FALSE;
}
}
}
SDL_LockJoysticks();