forked from mirrors/0ad
Fix memory leak in CCmpPathfinder, patch by Sandarac.
The terrain grid can be renewed without proper deallocation, which happens at least at the start of a game when MT_TerrainChanged is sent. Reviewers: wraitii, Itms Differential Revision: https://code.wildfiregames.com/D247 This was SVN commit r19388.
This commit is contained in:
@@ -470,6 +470,7 @@ void CCmpPathfinder::UpdateGrid()
|
||||
{
|
||||
m_MapSize = terrainSize;
|
||||
m_Grid = new Grid<NavcellData>(m_MapSize * Pathfinding::NAVCELLS_PER_TILE, m_MapSize * Pathfinding::NAVCELLS_PER_TILE);
|
||||
SAFE_DELETE(m_TerrainOnlyGrid);
|
||||
m_TerrainOnlyGrid = new Grid<NavcellData>(m_MapSize * Pathfinding::NAVCELLS_PER_TILE, m_MapSize * Pathfinding::NAVCELLS_PER_TILE);
|
||||
|
||||
m_ObstructionsDirty = { true, true, true, Grid<u8>(m_MapSize * Pathfinding::NAVCELLS_PER_TILE, m_MapSize * Pathfinding::NAVCELLS_PER_TILE) };
|
||||
|
||||
Reference in New Issue
Block a user