Commit 52aacd23 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dinput: Prevent a device interface leak when enumerating.

parent d666aea3
......@@ -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);
}
}
......
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