From 535f71fc13ced5ed1f68886fcd5aebb47d35f53c Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 8 Sep 2009 12:22:28 +0000 Subject: (svn r17472) -Fix [FS#3182]: industry list was rebuilt too early during industry removal causing the removed industry to be still in the list after removal --- src/industry_cmd.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/industry_cmd.cpp') diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 584a7e87e..05e9cb1b7 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -176,10 +176,18 @@ Industry::~Industry() DeleteIndustryNews(this->index); DeleteWindowById(WC_INDUSTRY_VIEW, this->index); - InvalidateWindowData(WC_INDUSTRY_DIRECTORY, 0, 0); DeleteSubsidyWith(ST_INDUSTRY, this->index); CargoPacket::InvalidateAllFrom(ST_INDUSTRY, this->index); +} + +/** + * Invalidating some stuff after removing item from the pool. + * @param index index of deleted item + */ +void Industry::PostDestructor(size_t index) +{ + InvalidateWindowData(WC_INDUSTRY_DIRECTORY, 0, 0); Station::RecomputeIndustriesNearForAll(); } -- cgit v1.2.3-54-g00ecf