dinput: Stop and unload effect when freeing it.
This commit is contained in:
parent
85e2aa1d8a
commit
91036a04a2
|
@ -724,17 +724,6 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters(
|
||||||
return DI_OK;
|
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(
|
static HRESULT WINAPI LinuxInputEffectImpl_Stop(
|
||||||
LPDIRECTINPUTEFFECT iface)
|
LPDIRECTINPUTEFFECT iface)
|
||||||
{
|
{
|
||||||
|
@ -768,6 +757,20 @@ static HRESULT WINAPI LinuxInputEffectImpl_Unload(
|
||||||
return DI_OK;
|
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
|
* LinuxInputEffect
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue