ensure use of subproc_main during unsafe destroy to avoid derefercing the heap

This commit is contained in:
daanx 2025-06-06 11:49:44 -07:00
parent a238d2bbbd
commit 7c7ecf096f
5 changed files with 28 additions and 24 deletions

View file

@ -779,8 +779,9 @@ void mi_cdecl _mi_process_done(void) {
mi_heap_collect(heap, true /* force */);
_mi_heap_unsafe_destroy_all(heap); // forcefully release all memory held by all heaps (of this thread only!)
_mi_arenas_unsafe_destroy_all(heap->tld);
_mi_page_map_unsafe_destroy();
_mi_page_map_unsafe_destroy(_mi_subproc_main());
}
//_mi_page_map_unsafe_destroy(_mi_subproc_main());
if (mi_option_is_enabled(mi_option_show_stats) || mi_option_is_enabled(mi_option_verbose)) {
mi_stats_print(NULL);