diff options
| author | yorah <yoram.harmelin@gmail.com> | 2013-05-30 11:30:34 +0200 |
|---|---|---|
| committer | yorah <yoram.harmelin@gmail.com> | 2013-05-30 11:45:11 +0200 |
| commit | d17db2fd771ed4e0dc7dee6c043b335a89bdd545 (patch) | |
| tree | 8d3e737c3c313b013c5a9102b77c6a0849adc7b8 /src | |
| parent | 504a4fd140223e17871e219ae17568b303c7c9a1 (diff) | |
| download | libgit2-d17db2fd771ed4e0dc7dee6c043b335a89bdd545.tar.gz | |
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`.
Diffstat (limited to 'src')
| -rw-r--r-- | src/win32/pthread.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/win32/pthread.c b/src/win32/pthread.c index 232709e54..2f263b3e0 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; } |
