From 33e522eec677ab4101ccd4b7c99fc3e3e229845a Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Wed, 17 Feb 2010 09:56:19 +0100 Subject: [PATCH] winhttp/tests: Wait for a handle closing notification. Fixes a Valgrind warning. --- dlls/winhttp/tests/notification.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/winhttp/tests/notification.c b/dlls/winhttp/tests/notification.c index 60e1595cb84..bd6db5811fe 100644 --- a/dlls/winhttp/tests/notification.c +++ b/dlls/winhttp/tests/notification.c @@ -88,7 +88,10 @@ static void CALLBACK check_notification( HINTERNET handle, DWORD_PTR context, DW } } if (status_ok) info->index++; - if (status & WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS) SetEvent( info->wait ); + if (status & (WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS | WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING)) + { + SetEvent( info->wait ); + } } static const struct notification cache_test[] = @@ -380,6 +383,8 @@ static void test_async( void ) WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); WinHttpCloseHandle( ses ); + + WaitForSingleObject( info.wait, INFINITE ); CloseHandle( info.wait ); }