mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	CPathfinderHelper: fix memory leak
This commit is contained in:
		| @@ -929,6 +929,12 @@ CPathfinderHelper::CPathfinderHelper(const CGHeroInstance * Hero, const CPathfin | ||||
| 	updateTurnInfo(); | ||||
| } | ||||
|  | ||||
| CPathfinderHelper::~CPathfinderHelper() | ||||
| { | ||||
| 	for(auto ti : turnsInfo) | ||||
| 		delete ti; | ||||
| } | ||||
|  | ||||
| void CPathfinderHelper::updateTurnInfo(const int Turn) | ||||
| { | ||||
| 	if(turn != Turn) | ||||
|   | ||||
| @@ -263,6 +263,7 @@ class DLL_LINKAGE CPathfinderHelper | ||||
| { | ||||
| public: | ||||
| 	CPathfinderHelper(const CGHeroInstance * Hero, const CPathfinder::PathfinderOptions & Options); | ||||
| 	~CPathfinderHelper(); | ||||
| 	void updateTurnInfo(const int turn = 0); | ||||
| 	bool isLayerAvailable(const EPathfindingLayer layer) const; | ||||
| 	const TurnInfo * getTurnInfo() const; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user