# HG changeset patch # User wenlin_fife@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1246392182 0 # Node ID 66df2422a8b04a96ce1c1cdfbb412da9fcb23b2e # Parent 6362c6812580683853490a8a91ae5f6ebd733c00 Added destructor to the routepathersearch class. Attempt to fix the memory leak reported by Unknown-Horizons. diff -r 6362c6812580 -r 66df2422a8b0 engine/core/pathfinder/routepather/routepathersearch.cpp --- a/engine/core/pathfinder/routepather/routepathersearch.cpp Fri Jun 26 18:04:57 2009 +0000 +++ b/engine/core/pathfinder/routepather/routepathersearch.cpp Tue Jun 30 20:03:02 2009 +0000 @@ -55,6 +55,11 @@ // m_searchspace = searchSpace; } + RoutePatherSearch::~RoutePatherSearch(){ + delete m_searchspace; + delete m_heuristic; + } + void RoutePatherSearch::updateSearch() { if(m_sortedfrontier.empty()) { setSearchStatus(search_status_failed); diff -r 6362c6812580 -r 66df2422a8b0 engine/core/pathfinder/routepather/routepathersearch.h --- a/engine/core/pathfinder/routepather/routepathersearch.h Fri Jun 26 18:04:57 2009 +0000 +++ b/engine/core/pathfinder/routepather/routepathersearch.h Tue Jun 30 20:03:02 2009 +0000 @@ -47,6 +47,8 @@ public: RoutePatherSearch(const int session_id, const Location& from, const Location& to, SearchSpace* searchSpace); + ~RoutePatherSearch(); + typedef std::list Path; /** An enumeration of the different status the search can be in. * @@ -95,6 +97,7 @@ m_status = status; } + private: //A location object representing where the search started. Location m_to; @@ -110,7 +113,6 @@ //An enumeration of the searches current status. SearchStatus m_status; - private: //The class to use to calculate the heuristic value. Heuristic* m_heuristic; //The destination coordinate as an int.