Avoid crashing in dinput_device_destroy, calling Unacquire while device resources may be already freed up.
From: Ivo Ivanov logos128@gmail.com Signed-off-by: Ivo Ivanov logos128@gmail.com Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index e0d15893bd4..3297e857afa 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -740,8 +740,6 @@ void dinput_device_destroy( IDirectInputDevice8W *iface )
TRACE( "iface %p.\n", iface );
- IDirectInputDevice_Unacquire(iface); - free( This->data_queue );
/* Free data format */ @@ -768,6 +766,7 @@ static ULONG WINAPI dinput_device_Release( IDirectInputDevice8W *iface )
if (!ref) { + IDirectInputDevice_Unacquire( iface ); if (impl->vtbl->release) impl->vtbl->release( iface ); else dinput_device_destroy( iface ); }