Vitaliy Margolen : dinput: Make sure to unacquire device before freeing it.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jun 4 08:14:34 CDT 2007


Module: wine
Branch: master
Commit: 6a8bf96d73bf0a737d148e1b653bca94f4ade310
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6a8bf96d73bf0a737d148e1b653bca94f4ade310

Author: Vitaliy Margolen <wine-patches at kievinfo.com>
Date:   Sun Jun  3 09:09:32 2007 -0600

dinput: Make sure to unacquire device before freeing it.

---

 dlls/dinput/joystick_linux.c      |    2 ++
 dlls/dinput/joystick_linuxinput.c |    2 ++
 dlls/dinput/keyboard.c            |    2 +-
 dlls/dinput/mouse.c               |    2 +-
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c
index 50a5f49..1eafcc7 100644
--- a/dlls/dinput/joystick_linux.c
+++ b/dlls/dinput/joystick_linux.c
@@ -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);
 
diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
index bfade84..b41145d 100644
--- a/dlls/dinput/joystick_linuxinput.c
+++ b/dlls/dinput/joystick_linuxinput.c
@@ -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);
 
diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c
index a4ba984..df11782 100644
--- a/dlls/dinput/keyboard.c
+++ b/dlls/dinput/keyboard.c
@@ -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);
 
diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c
index fcb98bb..ea551ef 100644
--- a/dlls/dinput/mouse.c
+++ b/dlls/dinput/mouse.c
@@ -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);




More information about the wine-cvs mailing list