From 91036a04a293caf2ac94a51954f23d390287bde3 Mon Sep 17 00:00:00 2001 From: Vitaliy Margolen Date: Sat, 5 Jul 2008 22:24:43 -0600 Subject: [PATCH] dinput: Stop and unload effect when freeing it. --- dlls/dinput/effect_linuxinput.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/dlls/dinput/effect_linuxinput.c b/dlls/dinput/effect_linuxinput.c index 4a31ec1022..ab72d2c4d8 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 */ -- 2.32.0.93.g670b81a890