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 520a30f3c7
commit d231a35d3b

View File

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