internal/gamepad: bug fix: release IDirectInputDevice8W on disconnecting

Closes #2205
This commit is contained in:
Hajime Hoshi 2022-07-15 15:44:37 +09:00
parent 4d93e6248d
commit bcb020627d

View File

@ -570,6 +570,9 @@ func (g *nativeGamepad) update(gamepads *gamepads) (err error) {
gamepads.remove(func(gamepad *Gamepad) bool {
return &gamepad.nativeGamepad == g
})
if g.dinputDevice != nil {
g.dinputDevice.Release()
}
}()
if g.usesDInput() {