# HG changeset patch # User smatz # Date 2009-09-22 18:50:58 # Node ID b67f197f314bbc52c3de92e0abacbcea68544bd4 # Parent 42528df8da134fe563a409cbe1096b9a64406a49 (svn r17614) -Fix: crash when deleting town while TownDirectory is open diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -78,7 +78,6 @@ Town::~Town() /* Delete town authority window * and remove from list of sorted towns */ DeleteWindowById(WC_TOWN_VIEW, this->index); - InvalidateWindowData(WC_TOWN_DIRECTORY, 0, 0); /* Delete all industries belonging to the town */ FOR_ALL_INDUSTRIES(i) if (i->town == this) delete i; @@ -121,6 +120,7 @@ Town::~Town() */ void Town::PostDestructor(size_t index) { + InvalidateWindowData(WC_TOWN_DIRECTORY, 0, 0); UpdateNearestTownForRoadTiles(false); }