Changeset - r18487:742a1f3c2adf
[Not reviewed]
master
0 1 0
rubidium - 13 years ago 2011-11-27 09:37:30
rubidium@openttd.org
(svn r23341) -Fix (r23338): memory leak when converting rails
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/rail_cmd.cpp
Show inline comments
 
@@ -1579,24 +1579,25 @@ CommandCost CmdConvertRail(TileIndex til
 
		for (uint i = 0; i < vehicles_affected.Length(); ++i) {
 
			TryPathReserve(vehicles_affected[i], true);
 
		}
 
	}
 

	
 
	if (flags & DC_EXEC) {
 
		/* Railtype changed, update trains as when entering different track */
 
		for (Train **v = affected_trains.Begin(); v != affected_trains.End(); v++) {
 
			(*v)->RailtypeChanged();
 
		}
 
	}
 

	
 
	delete iter;
 
	return (cost.GetCost() == 0) ? error : cost;
 
}
 

	
 
static CommandCost RemoveTrainDepot(TileIndex tile, DoCommandFlag flags)
 
{
 
	if (_current_company != OWNER_WATER) {
 
		CommandCost ret = CheckTileOwnership(tile);
 
		if (ret.Failed()) return ret;
 
	}
 

	
 
	CommandCost ret = EnsureNoVehicleOnGround(tile);
 
	if (ret.Failed()) return ret;
0 comments (0 inline, 0 general)