Skip to content

Commit

Permalink
Don't corrupt XInput device state during SDL_SYS_JoystickClose().
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 29, 2013
1 parent 2538d31 commit ea4350d
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/joystick/windows/SDL_dxjoystick.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit ea4350d

Please sign in to comment.