dinput: Make sure to unacquire device before freeing it.

This commit is contained in:
Vitaliy Margolen 2007-06-03 09:09:32 -06:00 committed by Alexandre Julliard
parent 0c503defcf
commit 6a8bf96d73
4 changed files with 6 additions and 2 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);