1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

CPathfinderHelper: fix memory leak

This commit is contained in:
Arseniy Shestakov 2016-08-16 14:59:16 +03:00
parent dea39b8497
commit b4a35f9c62
2 changed files with 7 additions and 0 deletions

View File

@ -929,6 +929,12 @@ CPathfinderHelper::CPathfinderHelper(const CGHeroInstance * Hero, const CPathfin
updateTurnInfo(); updateTurnInfo();
} }
CPathfinderHelper::~CPathfinderHelper()
{
for(auto ti : turnsInfo)
delete ti;
}
void CPathfinderHelper::updateTurnInfo(const int Turn) void CPathfinderHelper::updateTurnInfo(const int Turn)
{ {
if(turn != Turn) if(turn != Turn)

View File

@ -263,6 +263,7 @@ class DLL_LINKAGE CPathfinderHelper
{ {
public: public:
CPathfinderHelper(const CGHeroInstance * Hero, const CPathfinder::PathfinderOptions & Options); CPathfinderHelper(const CGHeroInstance * Hero, const CPathfinder::PathfinderOptions & Options);
~CPathfinderHelper();
void updateTurnInfo(const int turn = 0); void updateTurnInfo(const int turn = 0);
bool isLayerAvailable(const EPathfindingLayer layer) const; bool isLayerAvailable(const EPathfindingLayer layer) const;
const TurnInfo * getTurnInfo() const; const TurnInfo * getTurnInfo() const;