Commit 6a8bf96d authored by Vitaliy Margolen's avatar Vitaliy Margolen Committed by Alexandre Julliard

dinput: Make sure to unacquire device before freeing it.

parent 0c503def
......@@ -646,6 +646,8 @@ static ULONG WINAPI JoystickAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
if (ref)
return ref;
IDirectInputDevice_Unacquire(iface);
/* Free the device name */
HeapFree(GetProcessHeap(),0,This->name);
......
......@@ -516,6 +516,8 @@ static ULONG WINAPI JoystickAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
if (ref)
return ref;
IDirectInputDevice_Unacquire(iface);
/* Reset the FF state, free all effects, etc */
IDirectInputDevice8_SendForceFeedbackCommand(iface, DISFFC_RESET);
......
......@@ -281,7 +281,7 @@ static ULONG WINAPI SysKeyboardAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
ref = InterlockedDecrement(&This->base.ref);
if (ref) return ref;
set_dinput_hook(WH_KEYBOARD_LL, NULL);
IDirectInputDevice_Unacquire(iface);
HeapFree(GetProcessHeap(), 0, This->base.data_queue);
......
......@@ -268,7 +268,7 @@ static ULONG WINAPI SysMouseAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
if (ref)
return ref;
set_dinput_hook(WH_MOUSE_LL, NULL);
IDirectInputDevice_Unacquire(iface);
/* Free the data queue */
HeapFree(GetProcessHeap(), 0, This->base.data_queue);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment