This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
integrate changes#7205..7210,7212,7214..7219,7222,7223,7225,7226,
[perl5.git] / win32 / perllib.c
index fae3346..e2b245d 100644 (file)
@@ -372,6 +372,10 @@ DllMain(HANDLE hModule,            /* DLL module handle */
         */
     case DLL_PROCESS_DETACH:
        EndSockets();
+#if defined(USE_THREADS) || defined(USE_ITHREADS)
+       if (PL_curinterp)
+           FREE_THREAD_KEY;
+#endif
        break;
 
        /* The attached process creates a new thread. */