mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-08-05 06:16:47 -04:00
memory manager cleanup and removal
This commit is contained in:
@@ -336,10 +336,10 @@ void Persister::startSave(void)
|
||||
taskQueue->asyncRequest(new TaskSaveSnapshot(i->second));
|
||||
}
|
||||
for (i=m_newObjectSnapshots.begin(); i!=m_newObjectSnapshots.end(); ++i)
|
||||
{
|
||||
m_savingSnapshots.push_back(i->second);
|
||||
taskQueue->asyncRequest(new TaskSaveSnapshot(i->second));
|
||||
}
|
||||
{
|
||||
m_savingSnapshots.push_back(i->second);
|
||||
taskQueue->asyncRequest(new TaskSaveSnapshot(i->second));
|
||||
}
|
||||
|
||||
// nothing changed so send a complete message for the shutdown process
|
||||
if( m_savingSnapshots.empty() )
|
||||
@@ -602,10 +602,7 @@ void Persister::saveCompleted(Snapshot *completedSnapshot)
|
||||
SnapshotListType::iterator i=std::remove(m_savingSnapshots.begin(),m_savingSnapshots.end(),completedSnapshot);
|
||||
if (i!=m_savingSnapshots.end())
|
||||
{
|
||||
delete *i;
|
||||
i = m_savingSnapshots.erase(i, m_savingSnapshots.end());
|
||||
*i = nullptr;
|
||||
|
||||
m_savingSnapshots.erase(i, m_savingSnapshots.end());
|
||||
if (m_savingSnapshots.empty() && ConfigServerDatabase::getReportSaveTimes())
|
||||
{
|
||||
int saveTime = Clock::timeMs() - m_saveStartTime;
|
||||
@@ -637,9 +634,7 @@ 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 *j;
|
||||
*j = nullptr;
|
||||
j = m_savingCharacterSnapshots.erase(j, m_savingCharacterSnapshots.end());
|
||||
m_savingCharacterSnapshots.erase(j, m_savingCharacterSnapshots.end());
|
||||
DEBUG_REPORT_LOG(ConfigServerDatabase::getReportSaveTimes(),("New character save completed\n"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user