Core/Instances: Fix memory leak in InstanceSaveMgr
Fix memory leak in InstanceSaveMgr added in 1f170c99ef .
Make InstanceSave::SetToDelete() private since it's not supposed to be used by anything other than InstanceSave or its friend class InstanceSaveMgr .
This commit is contained in:
1 parent
88ecc9533a
commit
d78e69cdc6
2 files changed
+8
-4
No files matched your search
@@ -164,7 +164,11 @@ void InstanceSaveManager::RemoveInstanceSave(uint32 InstanceId)
|
||||
void InstanceSaveManager::UnloadInstanceSave(uint32 InstanceId)
|
||||
{
|
||||
if (InstanceSave* save = GetInstanceSave(InstanceId))
|
||||
{
|
||||
save->UnloadIfEmpty();
|
||||
if (save->m_toDelete)
|
||||
delete save;
|
||||
}
|
||||
}
|
||||
|
||||
InstanceSave::InstanceSave(uint16 MapId, uint32 InstanceId, Difficulty difficulty, time_t resetTime, bool canReset)
|
||||
|
||||
Reference in new issue
Block a user