fix issue #208: dynamic unloading of DLL with statically linked mimalloc
This commit is contained in:
parent
ab202fbe73
commit
5bc276c23b
@ -485,6 +485,10 @@ static void mi_process_done(void) {
|
||||
if (process_done) return;
|
||||
process_done = true;
|
||||
|
||||
#if defined(_WIN32) && !defined(MI_SHARED_LIB)
|
||||
FlsSetValue(mi_fls_key, NULL); // don't call main-thread callback
|
||||
FlsFree(mi_fls_key); // call thread-done on all threads to prevent dangling callback pointer if statically linked with a DLL; Issue #208
|
||||
#endif
|
||||
#ifndef NDEBUG
|
||||
mi_collect(true);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user