From 8c11cb676f08c9f096afd8b08be768a76c6d9f8b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 4 Jun 2017 14:18:28 +0200 Subject: [PATCH] fix some failing tests. --- src/kernel/region.c | 2 ++ src/kernel/unit.c | 1 + 2 files changed, 3 insertions(+) diff --git a/src/kernel/region.c b/src/kernel/region.c index 5cb86ff47..dc2fee21d 100644 --- a/src/kernel/region.c +++ b/src/kernel/region.c @@ -918,6 +918,8 @@ void free_region(region * r) unit *u = r->units; r->units = u->next; uunhash(u); + u->region = NULL; + u_setfaction(u, NULL); free_unit(u); free(u); } diff --git a/src/kernel/unit.c b/src/kernel/unit.c index d5317ec72..61cdac6c0 100644 --- a/src/kernel/unit.c +++ b/src/kernel/unit.c @@ -749,6 +749,7 @@ void free_units(void) while (deleted_units) { unit *u = deleted_units; deleted_units = deleted_units->next; + u_setfaction(u, NULL); free_unit(u); free(u); }