diff options
author | michi_cc <michi_cc@openttd.org> | 2009-03-09 18:41:54 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2009-03-09 18:41:54 +0000 |
commit | 80133f67ea23290159bd9ebc31badb25bd0ac8f9 (patch) | |
tree | 2526259204a4a0d0c1067d1b32df34720a12224a /src | |
parent | 0418e2c9d13a32326d2b321cb2abca60029fd999 (diff) | |
download | openttd-80133f67ea23290159bd9ebc31badb25bd0ac8f9.tar.xz |
(svn r15652) -Fix [FS#2706]: new (this) is seldom a good idea as destructors of member variables aren't run causing memory leaks.
Diffstat (limited to 'src')
-rw-r--r-- | src/vehicle.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 46e3de633..acd7f27dc 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -608,7 +608,7 @@ Vehicle::~Vehicle() DeleteVehicleNews(this->index, INVALID_STRING_ID); - new (this) InvalidVehicle(); + this->type = VEH_INVALID; } /** Adds a vehicle to the list of vehicles, that visited a depot this tick |