From 3e0bc4f26d4ef233d3eb05f28605b6495f7ff416 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 4 Jun 2017 14:35:15 +0200 Subject: [PATCH] cannot assert that free_unit has no faction (complicated reasons) --- src/kernel/region.c | 1 + src/kernel/unit.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kernel/region.c b/src/kernel/region.c index 5cb86ff47..b582c406e 100644 --- a/src/kernel/region.c +++ b/src/kernel/region.c @@ -917,6 +917,7 @@ void free_region(region * r) while (r->units) { unit *u = r->units; r->units = u->next; + u->region = NULL; uunhash(u); free_unit(u); free(u); diff --git a/src/kernel/unit.c b/src/kernel/unit.c index d5317ec72..7b6f135fc 100644 --- a/src/kernel/unit.c +++ b/src/kernel/unit.c @@ -1400,12 +1400,11 @@ int invisible(const unit * target, const unit * viewer) /** remove the unit from memory. * this frees all memory that's only accessible through the unit, * and you should already have called uunhash and removed the unit from the - * region and faction. + * region. */ void free_unit(unit * u) { assert(!u->region); - assert(!u->faction); free(u->_name); free(u->display); free_order(u->thisorder);