Skip to content

Commit c808493

Browse files
committed
fix assertion
1 parent 2a2b18f commit c808493

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/theap.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,11 @@ uintptr_t _mi_theap_random_next(mi_theap_t* theap) {
344344

345345
static void mi_theap_free_mem(mi_theap_t* theap) {
346346
if (theap!=NULL) {
347+
mi_subproc_t* const subproc = mi_atomic_load_ptr_relaxed(mi_subproc_t,&theap->subproc);
347348
if (!theap->is_detached) {
348-
mi_subproc_stat_decrease(_mi_theap_subproc(theap),theaps,1);
349+
mi_subproc_stat_decrease(subproc,theaps,1);
349350
}
350-
_mi_meta_free(_mi_theap_subproc(theap), theap, theap->memid);
351+
_mi_meta_free(subproc, theap, theap->memid);
351352
}
352353
}
353354

0 commit comments

Comments
 (0)