Skip to content

Commit

Permalink
Fix server cache memory leak (#4069)
Browse files Browse the repository at this point in the history
Fixes server cache memory leak on connecting to another server, by:
* Deleting XML node and file in CServerCache::StaticSaveServerCache

* Deleting XML node and file in CServerCache::LoadServerCache
  • Loading branch information
Lpsd authored Mar 5, 2025
1 parent e7c59fb commit e347659
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Client/core/ServerBrowser/CServerCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ bool CServerCache::LoadServerCache()

MapSet(m_ServerCachedMap, key, info);
}

delete pNode;
delete m_pConfigFile;

return true;
}

Expand Down Expand Up @@ -302,6 +306,9 @@ void CServerCache::StaticSaveServerCache()
XMLAccess.SetSubNodeValue(CONFIG_NODE_SERVER_INT "11", dataSet);

m_pConfigFile->Write();

delete pNode;
delete m_pConfigFile;
}

///////////////////////////////////////////////////////////////
Expand Down

0 comments on commit e347659

Please sign in to comment.