summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-02-19 18:02:17 +0000
committerrubidium <rubidium@openttd.org>2011-02-19 18:02:17 +0000
commit68bc93f95074702fde2876904198f585969201cc (patch)
treed4e944285ebe4ed2ea5bc068c1b854fbb5f95a4e /src/vehicle.cpp
parentf575b45bae4b84ad734541cdd59b794352f6c0c7 (diff)
downloadopenttd-68bc93f95074702fde2876904198f585969201cc.tar.xz
(svn r22111) -Codechange/fix-ish: upon cleaning a pool a destructor should not delete items from other pools
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index ec78d8f42..573610c6d 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -736,7 +736,10 @@ Vehicle::~Vehicle()
{
free(this->name);
- if (CleaningPool()) return;
+ if (CleaningPool()) {
+ this->cargo.OnCleanPool();
+ return;
+ }
/* sometimes, eg. for disaster vehicles, when company bankrupts, when removing crashed/flooded vehicles,
* it may happen that vehicle chain is deleted when visible */