Skip to content
Snippets Groups Projects
Commit 99fc12f9 authored by Ivo Ivanov's avatar Ivo Ivanov Committed by Alexandre Julliard
Browse files

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: default avatarIvo Ivanov <logos128@gmail.com>
Signed-off-by: default avatarRémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard's avatarAlexandre Julliard <julliard@winehq.org>
parent dbb735ef
Branches
Tags
No related merge requests found
......@@ -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 );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment