Vitaliy Margolen : dinput: Stop and unload effect when freeing it.

Alexandre Julliard julliard at winehq.org
Mon Jul 7 09:19:11 CDT 2008


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

Author: Vitaliy Margolen <wine-patches at kievinfo.com>
Date:   Sat Jul  5 22:24:43 2008 -0600

dinput: Stop and unload effect when freeing it.

---

 dlls/dinput/effect_linuxinput.c |   25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/dlls/dinput/effect_linuxinput.c b/dlls/dinput/effect_linuxinput.c
index 4a31ec1..ab72d2c 100644
--- a/dlls/dinput/effect_linuxinput.c
+++ b/dlls/dinput/effect_linuxinput.c
@@ -724,17 +724,6 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters(
     return DI_OK;
 }   
 
-static ULONG WINAPI LinuxInputEffectImpl_Release(
-	LPDIRECTINPUTEFFECT iface)
-{
-    LinuxInputEffectImpl *This = (LinuxInputEffectImpl *)iface;
-    ULONG ref = InterlockedDecrement(&(This->ref));
-
-    if (ref == 0)
-        HeapFree(GetProcessHeap(), 0, This);
-    return ref;
-}
-
 static HRESULT WINAPI LinuxInputEffectImpl_Stop(
         LPDIRECTINPUTEFFECT iface)
 {
@@ -768,6 +757,20 @@ static HRESULT WINAPI LinuxInputEffectImpl_Unload(
     return DI_OK;
 }
 
+static ULONG WINAPI LinuxInputEffectImpl_Release(LPDIRECTINPUTEFFECT iface)
+{
+    LinuxInputEffectImpl *This = (LinuxInputEffectImpl *)iface;
+    ULONG ref = InterlockedDecrement(&(This->ref));
+
+    if (ref == 0)
+    {
+        LinuxInputEffectImpl_Stop(iface);
+        LinuxInputEffectImpl_Unload(iface);
+        HeapFree(GetProcessHeap(), 0, This);
+    }
+    return ref;
+}
+
 /******************************************************************************
  *      LinuxInputEffect
  */




More information about the wine-cvs mailing list