Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e97d2d7 commit a1cf264Copy full SHA for a1cf264
src/global.c
@@ -224,6 +224,20 @@ void git__free_tls_data(void)
224
TlsSetValue(_tls_index, NULL);
225
}
226
227
+BOOL WINAPI DllMain(HINSTANCE hInstDll, DWORD fdwReason, LPVOID lpvReserved)
228
+{
229
+ /* This is how Windows lets us know our thread is being shut down */
230
+ if (fdwReason == DLL_THREAD_DETACH) {
231
+ git__free_tls_data();
232
+ }
233
+
234
+ /*
235
+ * Windows pays attention to this during library loading. We don't do anything
236
+ * so we trivially succeed.
237
+ */
238
+ return TRUE;
239
+}
240
241
#elif defined(GIT_THREADS) && defined(_POSIX_THREADS)
242
243
static pthread_key_t _tls_key;
0 commit comments