rpcrt4: Use an alertable wait in rpcrt4_protseq_np_wait_for_new_connection to fix a small memory leak flagged by Valgrind.

This is called only by the RPCRT4_server_thread so we don't have to 
worry about application user APCs being run at improper times.
This commit is contained in:
Rob Shearman 2007-12-06 15:08:11 +00:00 committed by Alexandre Julliard
parent 83a02c545c
commit 7092590c90

View File

@ -605,7 +605,15 @@ static int rpcrt4_protseq_np_wait_for_new_connection(RpcServerProtseq *protseq,
if (!objs)
return -1;
res = WaitForMultipleObjects(count, objs, FALSE, INFINITE);
do
{
/* an alertable wait isn't strictly necessary, but due to our
* overlapped I/O implementation in Wine we need to free some memory
* by the file user APC being called, even if no completion routine was
* specified at the time of starting the async operation */
res = WaitForMultipleObjectsEx(count, objs, FALSE, INFINITE, TRUE);
} while (res == WAIT_IO_COMPLETION);
if (res == WAIT_OBJECT_0)
return 0;
else if (res == WAIT_FAILED)