mirror of
https://github.com/glest/glest-source.git
synced 2025-09-02 12:32:34 +02:00
- fixed a bad memory leak in the pathfinder
This commit is contained in:
@@ -42,17 +42,22 @@ PathFinder::PathFinder(){
|
||||
}
|
||||
|
||||
PathFinder::PathFinder(const Map *map){
|
||||
init(map);
|
||||
nodePool= NULL;
|
||||
init(map);
|
||||
}
|
||||
|
||||
void PathFinder::init(const Map *map){
|
||||
if(nodePool != NULL) {
|
||||
delete [] nodePool;
|
||||
nodePool = NULL;
|
||||
}
|
||||
nodePool= new Node[pathFindNodesMax];
|
||||
this->map= map;
|
||||
}
|
||||
|
||||
PathFinder::~PathFinder(){
|
||||
delete [] nodePool;
|
||||
nodePool = NULL;
|
||||
}
|
||||
|
||||
TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos){
|
||||
|
Reference in New Issue
Block a user