dinput: Unacquire device when last public reference is released.
Avoid crashing in dinput_device_destroy, calling Unacquire while device resources may be already freed up. Signed-off-by: Ivo Ivanov <logos128@gmail.com> Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
dbb735efd1
commit
99fc12f9a3
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue