(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.
authorrubidium
Sat, 18 Aug 2007 22:56:58 +0000
changeset 7453 f0e43db55531
parent 7452 325eb4db1985
child 7454 e55eea8c05c7
(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
--- a/src/station.cpp	Fri Aug 17 15:55:19 2007 +0000
+++ b/src/station.cpp	Sat Aug 18 22:56:58 2007 +0000
@@ -69,6 +69,10 @@
 
 	if (CleaningPool()) return;
 
+	while (!loading_vehicles.empty()) {
+		loading_vehicles.front()->LeaveStation();
+	}
+
 	MarkDirty();
 	RebuildStationLists();
 	InvalidateWindowClasses(WC_STATION_LIST);