mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
avoid accessing heap->tld after running thread_done (pr #974)
This commit is contained in:
parent
e183384ad0
commit
9f70ce5fcd
3 changed files with 13 additions and 7 deletions
|
@ -393,9 +393,10 @@ void mi_heap_destroy(mi_heap_t* heap) {
|
|||
}
|
||||
|
||||
// forcefully destroy all heaps in the current thread
|
||||
void _mi_heap_unsafe_destroy_all(void) {
|
||||
mi_heap_t* bheap = mi_heap_get_backing();
|
||||
mi_heap_t* curr = bheap->tld->heaps;
|
||||
void _mi_heap_unsafe_destroy_all(mi_heap_t* heap) {
|
||||
mi_assert_internal(heap != NULL);
|
||||
if (heap == NULL) return;
|
||||
mi_heap_t* curr = heap->tld->heaps;
|
||||
while (curr != NULL) {
|
||||
mi_heap_t* next = curr->next;
|
||||
if (curr->no_reclaim) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue