Skip to content

Commit e347659

Browse files
authored
Fix server cache memory leak (#4069)
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
1 parent e7c59fb commit e347659

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Client/core/ServerBrowser/CServerCache.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ bool CServerCache::LoadServerCache()
186186

187187
MapSet(m_ServerCachedMap, key, info);
188188
}
189+
190+
delete pNode;
191+
delete m_pConfigFile;
192+
189193
return true;
190194
}
191195

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

304308
m_pConfigFile->Write();
309+
310+
delete pNode;
311+
delete m_pConfigFile;
305312
}
306313

307314
///////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)