dinput: Make sure to unacquire device before freeing it.
This commit is contained in:
parent
0c503defcf
commit
6a8bf96d73
|
@ -646,6 +646,8 @@ static ULONG WINAPI JoystickAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
|
||||||
if (ref)
|
if (ref)
|
||||||
return ref;
|
return ref;
|
||||||
|
|
||||||
|
IDirectInputDevice_Unacquire(iface);
|
||||||
|
|
||||||
/* Free the device name */
|
/* Free the device name */
|
||||||
HeapFree(GetProcessHeap(),0,This->name);
|
HeapFree(GetProcessHeap(),0,This->name);
|
||||||
|
|
||||||
|
|
|
@ -516,6 +516,8 @@ static ULONG WINAPI JoystickAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
|
||||||
if (ref)
|
if (ref)
|
||||||
return ref;
|
return ref;
|
||||||
|
|
||||||
|
IDirectInputDevice_Unacquire(iface);
|
||||||
|
|
||||||
/* Reset the FF state, free all effects, etc */
|
/* Reset the FF state, free all effects, etc */
|
||||||
IDirectInputDevice8_SendForceFeedbackCommand(iface, DISFFC_RESET);
|
IDirectInputDevice8_SendForceFeedbackCommand(iface, DISFFC_RESET);
|
||||||
|
|
||||||
|
|
|
@ -281,7 +281,7 @@ static ULONG WINAPI SysKeyboardAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
|
||||||
ref = InterlockedDecrement(&This->base.ref);
|
ref = InterlockedDecrement(&This->base.ref);
|
||||||
if (ref) return ref;
|
if (ref) return ref;
|
||||||
|
|
||||||
set_dinput_hook(WH_KEYBOARD_LL, NULL);
|
IDirectInputDevice_Unacquire(iface);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, This->base.data_queue);
|
HeapFree(GetProcessHeap(), 0, This->base.data_queue);
|
||||||
|
|
||||||
|
|
|
@ -268,7 +268,7 @@ static ULONG WINAPI SysMouseAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
|
||||||
if (ref)
|
if (ref)
|
||||||
return ref;
|
return ref;
|
||||||
|
|
||||||
set_dinput_hook(WH_MOUSE_LL, NULL);
|
IDirectInputDevice_Unacquire(iface);
|
||||||
|
|
||||||
/* Free the data queue */
|
/* Free the data queue */
|
||||||
HeapFree(GetProcessHeap(), 0, This->base.data_queue);
|
HeapFree(GetProcessHeap(), 0, This->base.data_queue);
|
||||||
|
|
Loading…
Reference in New Issue