readd the delete - this branch i'm not sure if we need or not, same goes

for smart ptr branch
This commit is contained in:
DarthArgus
2016-11-29 23:13:28 +00:00
parent 8ebe434e0b
commit cd3c1f3fe8
2 changed files with 7 additions and 0 deletions
@@ -602,6 +602,8 @@ void Persister::saveCompleted(Snapshot *completedSnapshot)
SnapshotListType::iterator i=std::remove(m_savingSnapshots.begin(),m_savingSnapshots.end(),completedSnapshot);
if (i!=m_savingSnapshots.end())
{
delete completedSnapshot;
m_savingSnapshots.erase(i, m_savingSnapshots.end());
if (m_savingSnapshots.empty() && ConfigServerDatabase::getReportSaveTimes())
{
@@ -634,6 +636,8 @@ void Persister::saveCompleted(Snapshot *completedSnapshot)
{
SnapshotListType::iterator j=std::remove(m_savingCharacterSnapshots.begin(),m_savingCharacterSnapshots.end(),completedSnapshot);
DEBUG_FATAL(i==m_savingCharacterSnapshots.end(),("Programmer bug: SaveCompleted() called with a snapshot that wasn't in m_savingSnapshots or m_savingCharacterSnapshots."));
delete completedSnapshot;
m_savingCharacterSnapshots.erase(j, m_savingCharacterSnapshots.end());
DEBUG_REPORT_LOG(ConfigServerDatabase::getReportSaveTimes(),("New character save completed\n"));
}
@@ -50,6 +50,9 @@ Snapshot::~Snapshot()
*j = nullptr;
}
m_locatorList.clear();
m_customStepList.clear();
++ms_deletionCount;
LOG("Snapshot",("Deleted snapshot. %i outstanding, %i created, %i deleted", ms_creationCount-ms_deletionCount,ms_creationCount,ms_deletionCount));
}