From: Martin Quinson Date: Fri, 26 Aug 2016 15:30:26 +0000 (+0200) Subject: the order of atexit() seem to be different on FreeBSD X-Git-Tag: v3_14~484 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/845ee678cf3a64235c8c8f14bcb9c49e43c8f60a the order of atexit() seem to be different on FreeBSD --- diff --git a/src/xbt/mallocator.c b/src/xbt/mallocator.c index 295ea55dfa..f898c39e80 100644 --- a/src/xbt/mallocator.c +++ b/src/xbt/mallocator.c @@ -196,6 +196,8 @@ void *xbt_mallocator_get(xbt_mallocator_t m) */ void xbt_mallocator_release(xbt_mallocator_t m, void *object) { + if (m == NULL) // The mallocators are already destroyed. Bail out ASAP. + return; if (m->objects != NULL) { // Go for it lock_acquire(m); if (m->current_size < m->max_size) {