Commit 8e851c1e by Edward Thomson Committed by Carlos Martín Nieto

libgit2_shutdown: free TLS data (win32)

Free TLS data on thread exit (win32)
parent 83fe60fa
......@@ -270,6 +270,17 @@ git_global_st *git__global_state(void)
return ptr;
}
BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, LPVOID reserved)
{
if (reason == DLL_THREAD_DETACH) {
void *ptr = TlsGetValue(_tls_index);
git__global_state_cleanup(ptr);
git__free(ptr);
}
return TRUE;
}
#elif defined(GIT_THREADS) && defined(_POSIX_THREADS)
static pthread_key_t _tls_key;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment