Commit ab61ff13 authored by Sven Baars's avatar Sven Baars Committed by Michael Stefaniuc

dinput: Free the device after a callback (Valgrind).

Signed-off-by: 's avatarSven Baars <sven.wine@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org> (cherry picked from commit cf1b9fe2) Signed-off-by: 's avatarMichael Stefaniuc <mstefani@winehq.org>
parent 2e87908e
......@@ -1104,10 +1104,12 @@ static HRESULT WINAPI IDirectInput8AImpl_EnumDevicesBySemantics(
if (lpCallback(&didevis[i], lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP)
{
IDirectInputDevice_Release(lpdid);
HeapFree(GetProcessHeap(), 0, didevis);
HeapFree(GetProcessHeap(), 0, username_w);
return DI_OK;
}
IDirectInputDevice_Release(lpdid);
}
HeapFree(GetProcessHeap(), 0, didevis);
......@@ -1130,9 +1132,11 @@ static HRESULT WINAPI IDirectInput8AImpl_EnumDevicesBySemantics(
if (lpCallback(&didevi, lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP)
{
IDirectInputDevice_Release(lpdid);
HeapFree(GetProcessHeap(), 0, username_w);
return DI_OK;
}
IDirectInputDevice_Release(lpdid);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment