call destroyfaction instead of free as a quick fix

This commit is contained in:
Enno Rehling 2016-01-10 12:07:00 +01:00
parent 4f7b274bf6
commit 7d426dc3ed
1 changed files with 4 additions and 2 deletions

View File

@ -322,7 +322,7 @@ variant read_faction_reference(struct storage * store)
void write_faction_reference(const faction * f, struct storage *store)
{
WRITE_INT(store, f ? f->no : 0);
WRITE_INT(store, (f && f->alive) ? f->no : 0);
}
void destroyfaction(faction * f)
@ -681,7 +681,9 @@ void remove_empty_factions(void)
if (f->alliance && f->alliance->_leader == f) {
setalliance(f, 0);
}
free(f);
destroyfaction(f); // TODO: there was a free() here,
// are we duplicating efforts here that also happen
// in destroyfaction?
}
else
fp = &(*fp)->next;