From ab7e36dda704a3ed47ceaf2abb903079d1bea3df Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 6 Aug 2007 14:08:25 +0000 Subject: [PATCH] (svn r10813) -Fix (r10799): some destructors were performing too much during the pool cleanups, which could cause crashes as already removed pool items could then be dereferenced by other destructors. --- src/industry_cmd.cpp | 2 ++ src/station.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index c46cbac511..a592642ddb 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -130,6 +130,8 @@ const IndustryTileSpec *GetIndustryTileSpec(IndustryGfx gfx, bool full_check) Industry::~Industry() { + if (CleaningPool()) return; + /* Industry can also be destroyed when not fully initialized. * This means that we do not have to clear tiles either. */ if (this->width == 0) { diff --git a/src/station.cpp b/src/station.cpp index 150719e8fd..fab0395b70 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -391,6 +391,8 @@ RoadStop::RoadStop(TileIndex tile) : */ RoadStop::~RoadStop() { + if (CleaningPool()) return; + /* Clear the slot assignment of all vehicles heading for this road stop */ if (num_vehicles != 0) { Vehicle *v;