mirror of
https://bitbucket.org/seefoe/src.git
synced 2026-07-15 00:07:34 -04:00
maybe try this?
This commit is contained in:
@@ -602,9 +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())
|
||||
{
|
||||
@@ -637,11 +635,16 @@ 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"));
|
||||
}
|
||||
|
||||
if (completedSnapshot) {
|
||||
delete completedSnapshot;
|
||||
completedSnapshot = nullptr; // in case of double deletes by any other pointers to this thing
|
||||
} else {
|
||||
DEBUG_WARNING(true, ("We just attempted a double delete!"));
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user