# HG changeset patch # User rubidium # Date 2007-08-06 14:08:25 # Node ID 9706ae234622d078f7659fc5369db126a42e7ea9 # Parent e9100cbd3960ef2bf084d4f9d738f4c636be5bc3 (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. diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -130,6 +130,8 @@ const IndustryTileSpec *GetIndustryTileS 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 --- 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;