Commit b2984e8aac646219b06c4e0264e2d7556120b76b

Ben Straub 2013-05-30T08:43:14

Merge pull request #1622 from yorah/fix/thread-segfault thread: fix segfault on Windows 64 bits

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/win32/pthread.c b/src/win32/pthread.c
index 232709e..2f263b3 100644
--- a/src/win32/pthread.c
+++ b/src/win32/pthread.c
@@ -24,8 +24,10 @@ int pthread_join(pthread_t thread, void **value_ptr)
 	DWORD ret = WaitForSingleObject(thread, INFINITE);
 
 	if (ret == WAIT_OBJECT_0) {
-		if (value_ptr != NULL)
+		if (value_ptr != NULL) {
+			*value_ptr = NULL;
 			GetExitCodeThread(thread, (void *)value_ptr);
+		}
 		CloseHandle(thread);
 		return 0;
 	}