Skip to content
Permalink
Browse files

Don't corrupt XInput device state during SDL_SYS_JoystickClose().

  • Loading branch information
icculus committed Aug 29, 2013
1 parent 2538d31 commit ea4350d821c9aed330b7a5af3d0cfa5bea2f731f
Showing with 1 addition and 15 deletions.
  1. +1 −15 src/joystick/windows/SDL_dxjoystick.c
@@ -1552,21 +1552,7 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
void
SDL_SYS_JoystickClose(SDL_Joystick * joystick)
{
if ( joystick->hwdata->bXInputDevice )
{
JoyStick_DeviceData *joysticklist = SYS_Joystick;
/* scan the opened joysticks and clear the userid for this instance */
for( ; joysticklist; joysticklist = joysticklist->pNext)
{
if ( joysticklist->bXInputDevice && joysticklist->nInstanceID == joystick->instance_id )
{
joysticklist->XInputUserId = INVALID_XINPUT_USERID;
}
}

}
else
{
if (!joystick->hwdata->bXInputDevice) {
IDirectInputDevice8_Unacquire(joystick->hwdata->InputDevice);
IDirectInputDevice8_Release(joystick->hwdata->InputDevice);
}

0 comments on commit ea4350d

Please sign in to comment.