From 80133f67ea23290159bd9ebc31badb25bd0ac8f9 Mon Sep 17 00:00:00 2001 From: michi_cc Date: Mon, 9 Mar 2009 18:41:54 +0000 Subject: (svn r15652) -Fix [FS#2706]: new (this) is seldom a good idea as destructors of member variables aren't run causing memory leaks. --- src/vehicle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3-54-g00ecf