diff options
-rw-r--r-- | src/basic/hashmap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c index 65e22ccd21..44d718c83d 100644 --- a/src/basic/hashmap.c +++ b/src/basic/hashmap.c @@ -869,9 +869,11 @@ static void hashmap_free_no_clear(HashmapBase *h) { assert_se(pthread_mutex_unlock(&hashmap_debug_list_mutex) == 0); #endif - if (h->from_pool) + if (h->from_pool) { + /* Ensure that the object didn't get migrated between threads. */ + assert_se(is_main_thread()); mempool_free_tile(hashmap_type_info[h->type].mempool, h); - else + } else free(h); } |