mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-18 13:09:32 +03:00
fix crash on exit on Android with destroy_on_exit
This commit is contained in:
parent
7085b6cec3
commit
08acde5da0
1 changed files with 4 additions and 3 deletions
|
@ -663,9 +663,6 @@ void mi_cdecl _mi_process_done(void) {
|
|||
if (process_done) return;
|
||||
process_done = true;
|
||||
|
||||
// release any thread specific resources and ensure _mi_thread_done is called on all but the main thread
|
||||
_mi_prim_thread_done_auto_done();
|
||||
|
||||
#ifndef MI_SKIP_COLLECT_ON_EXIT
|
||||
#if (MI_DEBUG || !defined(MI_SHARED_LIB))
|
||||
// free all memory if possible on process exit. This is not needed for a stand-alone process
|
||||
|
@ -684,6 +681,10 @@ void mi_cdecl _mi_process_done(void) {
|
|||
_mi_arena_unsafe_destroy_all();
|
||||
}
|
||||
|
||||
// release any thread specific resources and ensure _mi_thread_done is called on all but the main thread
|
||||
// this must be done after _mi_heap_unsafe_destroy_all, which accesses the default heap
|
||||
_mi_prim_thread_done_auto_done();
|
||||
|
||||
if (mi_option_is_enabled(mi_option_show_stats) || mi_option_is_enabled(mi_option_verbose)) {
|
||||
mi_stats_print(NULL);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue