winhttp/tests: Wait for a handle closing notification.
authorHans Leidekker <hans@codeweavers.com>
Wed, 17 Feb 2010 08:56:19 +0000 (09:56 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 17 Feb 2010 09:57:53 +0000 (10:57 +0100)
Fixes a Valgrind warning.

dlls/winhttp/tests/notification.c

index 60e1595cb847dd04140734ea6aeb1976b38aaf35..bd6db5811fed7146f96889aaadcb77695cccc6db 100644 (file)
@@ -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 );
 }