Memory leak
try to use to find path in platformer game prototype. Work well, but every time is start Pathfind, memory of used by program increase. This array of pointers squares = new Square* [gameMapWidth]; for(int x=0; x<gameMapWidth; x++) squares[x] = new Square[gameMapHeight]; define once.
You need to deallocate every array stored in squares[x] and squares itself.
See https://github.com/Sahnvour/PathFinder/blob/03bac25118aaa65822d036ac9f3b82124b681ad9/examples/image.cpp#L171-L173
If your memory usage increases every time, this also means that you are allocating and constructing the pathfinding data on every request. You might want to instead do this only once and reuse it.
If your memory usage increases every time, this also means that you are allocating and constructing the pathfinding data on every request. You might want to instead do this only once and reuse it. Also try next way: allocate arrays in initialization of struct(class) and than use allocated arrays, and problem of memory leak is actual. And changes of start point also have a problems, if need to change it. Some time it changes, sometime algoritm use old (experiments with A* version)