summaryrefslogtreecommitdiff
path: root/src/station.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/station.cpp')
-rw-r--r--src/station.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/station.cpp b/src/station.cpp
index b25f48a3f..47389d79c 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -35,6 +35,16 @@ BaseStation::~BaseStation()
{
free(this->name);
free(this->speclist);
+
+ if (CleaningPool()) return;
+
+ Owner owner = this->owner;
+ if (!Company::IsValidID(owner)) owner = _local_company;
+ WindowNumber wno = (this->index << 16) | VLW_STATION_LIST | owner;
+ DeleteWindowById(WC_TRAINS_LIST, wno | (VEH_TRAIN << 11));
+ DeleteWindowById(WC_ROADVEH_LIST, wno | (VEH_ROAD << 11));
+ DeleteWindowById(WC_SHIPS_LIST, wno | (VEH_SHIP << 11));
+ DeleteWindowById(WC_AIRCRAFT_LIST, wno | (VEH_AIRCRAFT << 11));
}
Station::Station(TileIndex tile) :
@@ -83,14 +93,6 @@ Station::~Station()
DeleteWindowById(WC_STATION_VIEW, index);
- Owner owner = this->owner;
- if (!Company::IsValidID(owner)) owner = _local_company;
- WindowNumber wno = (this->index << 16) | VLW_STATION_LIST | owner;
- DeleteWindowById(WC_TRAINS_LIST, wno | (VEH_TRAIN << 11));
- DeleteWindowById(WC_ROADVEH_LIST, wno | (VEH_ROAD << 11));
- DeleteWindowById(WC_SHIPS_LIST, wno | (VEH_SHIP << 11));
- DeleteWindowById(WC_AIRCRAFT_LIST, wno | (VEH_AIRCRAFT << 11));
-
/* Now delete all orders that go to the station */
RemoveOrderFromAllVehicles(OT_GOTO_STATION, this->index);