From 81595bf25674784bd898d930cd753bdb922006ad Mon Sep 17 00:00:00 2001 From: michi_cc Date: Mon, 9 Mar 2009 18:41:54 +0000 Subject: [PATCH] (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(-) diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 46e3de633e..acd7f27dc0 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