From 69cc90957c2118fc503ea9e18e7b2a14243c7685 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Thu, 20 Nov 2014 12:51:06 +0100 Subject: [PATCH] ws2_32/tests: Wait for thread termination before cleaning up winsock. --- dlls/ws2_32/tests/sock.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 0c395457e11..acc2783169c 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -4354,7 +4354,11 @@ end: if (dst != INVALID_SOCKET) closesocket(dst); if (hThread != NULL) + { + dwRet = WaitForSingleObject(hThread, 500); + ok(dwRet == WAIT_OBJECT_0, "failed to wait for thread termination: %d\n", GetLastError()); CloseHandle(hThread); + } if (ov.hEvent) CloseHandle(ov.hEvent); HeapFree(GetProcessHeap(), 0, buffer);