From fda1c9d34a3f6d8c3edd103587e28758d703221b Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 18 Aug 2007 22:56:58 +0000 Subject: (svn r10931) -Fix [FS#1131]: when a station was destroyed and a vehicle was still loading, changing the current order of the loading vehicle caused a crash. This could happen with removing docks and oil rigs. --- src/station.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/station.cpp b/src/station.cpp index fab0395b7..16723fc68 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -69,6 +69,10 @@ Station::~Station() if (CleaningPool()) return; + while (!loading_vehicles.empty()) { + loading_vehicles.front()->LeaveStation(); + } + MarkDirty(); RebuildStationLists(); InvalidateWindowClasses(WC_STATION_LIST); -- cgit v1.2.3-70-g09d2