mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-21 21:36:50 +00:00
libgit2_shutdown: free TLS data (win32)
Free TLS data on thread exit (win32)
This commit is contained in:
parent
83fe60fa1b
commit
8e851c1e8c
11
src/global.c
11
src/global.c
@ -270,6 +270,17 @@ git_global_st *git__global_state(void)
|
|||||||
return ptr;
|
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)
|
#elif defined(GIT_THREADS) && defined(_POSIX_THREADS)
|
||||||
|
|
||||||
static pthread_key_t _tls_key;
|
static pthread_key_t _tls_key;
|
||||||
|
Loading…
Reference in New Issue
Block a user