dinput: Free the device after a callback (Valgrind).
Signed-off-by: Sven Baars <sven.wine@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
2543295a15
commit
cf1b9fe2c7
|
@ -1104,10 +1104,12 @@ static HRESULT WINAPI IDirectInput8AImpl_EnumDevicesBySemantics(
|
||||||
|
|
||||||
if (lpCallback(&didevis[i], lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP)
|
if (lpCallback(&didevis[i], lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP)
|
||||||
{
|
{
|
||||||
|
IDirectInputDevice_Release(lpdid);
|
||||||
HeapFree(GetProcessHeap(), 0, didevis);
|
HeapFree(GetProcessHeap(), 0, didevis);
|
||||||
HeapFree(GetProcessHeap(), 0, username_w);
|
HeapFree(GetProcessHeap(), 0, username_w);
|
||||||
return DI_OK;
|
return DI_OK;
|
||||||
}
|
}
|
||||||
|
IDirectInputDevice_Release(lpdid);
|
||||||
}
|
}
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, didevis);
|
HeapFree(GetProcessHeap(), 0, didevis);
|
||||||
|
@ -1130,9 +1132,11 @@ static HRESULT WINAPI IDirectInput8AImpl_EnumDevicesBySemantics(
|
||||||
|
|
||||||
if (lpCallback(&didevi, lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP)
|
if (lpCallback(&didevi, lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP)
|
||||||
{
|
{
|
||||||
|
IDirectInputDevice_Release(lpdid);
|
||||||
HeapFree(GetProcessHeap(), 0, username_w);
|
HeapFree(GetProcessHeap(), 0, username_w);
|
||||||
return DI_OK;
|
return DI_OK;
|
||||||
}
|
}
|
||||||
|
IDirectInputDevice_Release(lpdid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue