(svn r15652) -Fix [FS#2706]: new (this) is seldom a good idea as destructors of member variables aren't run causing memory leaks.
This commit is contained in:
@@ -608,7 +608,7 @@ Vehicle::~Vehicle()
|
|||||||
|
|
||||||
DeleteVehicleNews(this->index, INVALID_STRING_ID);
|
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
|
/** Adds a vehicle to the list of vehicles, that visited a depot this tick
|
||||||
|
Reference in New Issue
Block a user