[Fix] Repair a EQEMUConfig Memory Leak (#4584)

Co-authored-by: Mitch Freeman <neckkola@gmail.com>
This commit is contained in:
Mitch Freeman
2025-01-06 01:45:28 -04:00
committed by GitHub
parent b40e4ce7cd
commit 33db85f2ee
2 changed files with 8 additions and 6 deletions
+7 -5
View File
@@ -43,11 +43,13 @@ class ZoneConfig : public EQEmuConfig {
}
// Load the config
static bool LoadConfig(const std::string& path = "") {
if (_zone_config != nullptr)
delete _zone_config;
_zone_config=new ZoneConfig;
_config=_zone_config;
static bool LoadConfig(const std::string &path = "")
{
safe_delete(_zone_config);
safe_delete(_config);
_zone_config = new ZoneConfig;
_config = _zone_config;
return _config->parseFile(path);
}