Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=36263 Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/dinput_main.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index 62e70e0535c..c7b932aca44 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -864,8 +864,10 @@ static HRESULT WINAPI IDirectInput8WImpl_EnumDevicesBySemantics( if (lpCallback(&didevis[i], lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP) { HeapFree(GetProcessHeap(), 0, didevis); + IDirectInputDevice_Release(lpdid); return DI_OK; } + IDirectInputDevice_Release(lpdid); }
HeapFree(GetProcessHeap(), 0, didevis); @@ -883,7 +885,11 @@ static HRESULT WINAPI IDirectInput8WImpl_EnumDevicesBySemantics( IDirectInputDevice_GetDeviceInfo(lpdid, &didevi);
if (lpCallback(&didevi, lpdid, callbackFlags, --remain, pvRef) == DIENUM_STOP) + { + IDirectInputDevice_Release(lpdid); return DI_OK; + } + IDirectInputDevice_Release(lpdid); } }