mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
[Fix] Repair a EQEMUConfig Memory Leak (#4584)
Co-authored-by: Mitch Freeman <neckkola@gmail.com>
This commit is contained in:
parent
b40e4ce7cd
commit
33db85f2ee
@ -137,9 +137,9 @@ class EQEmuConfig
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual ~EQEmuConfig() {}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
virtual ~EQEmuConfig() {}
|
||||||
|
|
||||||
// Produce a const singleton
|
// Produce a const singleton
|
||||||
static const EQEmuConfig *get()
|
static const EQEmuConfig *get()
|
||||||
|
|||||||
@ -43,11 +43,13 @@ class ZoneConfig : public EQEmuConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load the config
|
// Load the config
|
||||||
static bool LoadConfig(const std::string& path = "") {
|
static bool LoadConfig(const std::string &path = "")
|
||||||
if (_zone_config != nullptr)
|
{
|
||||||
delete _zone_config;
|
safe_delete(_zone_config);
|
||||||
_zone_config=new ZoneConfig;
|
safe_delete(_config);
|
||||||
_config=_zone_config;
|
|
||||||
|
_zone_config = new ZoneConfig;
|
||||||
|
_config = _zone_config;
|
||||||
|
|
||||||
return _config->parseFile(path);
|
return _config->parseFile(path);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user