mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-20 22:05:37 +00:00
thread: fix segfault on Windows 64 bits
`lpExitCode` is a pointer to a long. A long is 32 bits wide on Windows. It means that on Windows 64bits, `GetExitCodeThread()` doesn't set/clear the high-order bytes of the 64 bits memory space pointed at by `value_ptr`.
This commit is contained in:
parent
504a4fd140
commit
d17db2fd77
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user