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 | 81595bf25674784bd898d930cd753bdb922006ad (patch) | |
tree | 2526259204a4a0d0c1067d1b32df34720a12224a /src | |
parent | 66672418144262be8ea1d9c7f7f635877ece71ab (diff) | |
download | openttd-81595bf25674784bd898d930cd753bdb922006ad.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 |