[PATCH v2 1/4] hid/tests: Call CancelIo before closing device.

Zebediah Figura z.figura12 at gmail.com
Tue Feb 11 14:09:13 CST 2020


On 2/11/20 12:13 PM, Rémi Bernon wrote:
> This was causing some leak to be reported on wineserver shutdown when
> no data can be read from a device.
> 
> Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
> ---
>   dlls/hid/tests/device.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/dlls/hid/tests/device.c b/dlls/hid/tests/device.c
> index bb819cc83f2..19f450045f1 100644
> --- a/dlls/hid/tests/device.c
> +++ b/dlls/hid/tests/device.c
> @@ -316,6 +316,7 @@ static void test_read_device(void)
>       CloseHandle(overlapped.hEvent);
>       rc = HidD_FreePreparsedData(ppd);
>       ok(rc, "Failed to free preparsed data(0x%x)\n", GetLastError());
> +    CancelIo(device);
>       CloseHandle(device);
>       HeapFree(GetProcessHeap(), 0, data);
>       HeapFree(GetProcessHeap(), 0, report);
> 

I vaguely recall having seen this leak intermittently as well, and while 
avoiding the leak in the tests is probably a good idea, I think it's 
wrong that that leak occurs no matter what "userspace" does. That is, 
probably some object in wineserver is holding a reference that doesn't 
release it when it gets destroyed.



More information about the wine-devel mailing list