mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-08-04 05:15:51 -04:00
finish removing the SOE memory management
This commit is contained in:
@@ -2,6 +2,6 @@
|
||||
#define INCLUDED_FirstServerDatabase_H
|
||||
|
||||
#include "sharedFoundation/FirstSharedFoundation.h"
|
||||
#include "sharedMemoryManager/FirstSharedMemoryManager.h"
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -174,15 +174,44 @@ Persister::~Persister()
|
||||
{
|
||||
DEBUG_FATAL(taskQueue,("Call shutdown() before deleting Persister.\n"));
|
||||
|
||||
ServerSnapshotMap::iterator i;
|
||||
for (i=m_currentSnapshots.begin(); i!=m_currentSnapshots.end(); ++i)
|
||||
for (auto i = m_currentSnapshots.begin(); i!=m_currentSnapshots.end(); ++i) {
|
||||
delete i->second;
|
||||
for (i=m_newObjectSnapshots.begin(); i!=m_newObjectSnapshots.end(); ++i)
|
||||
i->second = nullptr;
|
||||
}
|
||||
|
||||
for (auto i = m_newObjectSnapshots.begin(); i!=m_newObjectSnapshots.end(); ++i) {
|
||||
delete i->second;
|
||||
i->second = nullptr;
|
||||
}
|
||||
|
||||
for (auto i = m_newCharacterSnapshots.begin(); i!=m_newCharacterSnapshots.end(); ++i) {
|
||||
delete i->second;
|
||||
i->second = nullptr;
|
||||
}
|
||||
|
||||
for (auto i = m_objectSnapshotMap.begin(); i!=m_objectSnapshotMap.end(); ++i) {
|
||||
delete i->second;
|
||||
i->second = nullptr;
|
||||
}
|
||||
|
||||
for (auto i = m_savingSnapshots.begin(); i!=m_savingSnapshots.end(); ++i) {
|
||||
delete *i;
|
||||
*i = nullptr;
|
||||
}
|
||||
|
||||
for (auto i = m_savingCharacterSnapshots.begin(); i!=m_savingCharacterSnapshots.end(); ++i) {
|
||||
delete *i;
|
||||
*i = nullptr;
|
||||
}
|
||||
|
||||
m_currentSnapshots.clear();
|
||||
m_newObjectSnapshots.clear();
|
||||
m_objectSnapshotMap.clear();
|
||||
|
||||
delete m_messageSnapshot;
|
||||
delete m_commoditiesSnapshot;
|
||||
delete m_arbitraryGameDataSnapshot;
|
||||
|
||||
m_messageSnapshot = nullptr;
|
||||
m_commoditiesSnapshot = nullptr;
|
||||
m_arbitraryGameDataSnapshot = nullptr;
|
||||
|
||||
@@ -50,8 +50,11 @@ 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));
|
||||
LOG("Snapshot",("Deleted snapshot. %i outstanding, %i created, %i deleted", ms_creationCount-ms_deletionCount,ms_creationCount,ms_deletionCount));
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -30,6 +30,9 @@ void TaskSaveSnapshot::onComplete()
|
||||
{
|
||||
m_snapshot->saveCompleted();
|
||||
Persister::getInstance().saveCompleted(m_snapshot);
|
||||
|
||||
delete m_snapshot;
|
||||
m_snapshot = nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
Reference in New Issue
Block a user