diff --git a/engine/server/library/serverDatabase/src/shared/Persister.cpp b/engine/server/library/serverDatabase/src/shared/Persister.cpp index 736a98e5..a369e6e7 100755 --- a/engine/server/library/serverDatabase/src/shared/Persister.cpp +++ b/engine/server/library/serverDatabase/src/shared/Persister.cpp @@ -602,6 +602,9 @@ void Persister::saveCompleted(Snapshot *completedSnapshot) SnapshotListType::iterator i=std::remove(m_savingSnapshots.begin(),m_savingSnapshots.end(),completedSnapshot); if (i!=m_savingSnapshots.end()) { + delete completedSnapshot; + completedSnapshot = nullptr; + m_savingSnapshots.erase(i, m_savingSnapshots.end()); if (m_savingSnapshots.empty() && ConfigServerDatabase::getReportSaveTimes()) { @@ -634,7 +637,9 @@ 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; + completedSnapshot = nullptr; + m_savingCharacterSnapshots.erase(j, m_savingCharacterSnapshots.end()); DEBUG_REPORT_LOG(ConfigServerDatabase::getReportSaveTimes(),("New character save completed\n")); } diff --git a/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.cpp b/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.cpp index c0e0a5bf..bb2c58f7 100755 --- a/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.cpp +++ b/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.cpp @@ -38,6 +38,8 @@ ObjvarBuffer::ObjvarBuffer(DB::ModeQuery::Mode mode, ObjectTableBuffer *objectTa ObjvarBuffer::~ObjvarBuffer() { + m_data.clear(); + m_overrides.clear(); } bool ObjvarBuffer::load(DB::Session *session,const DB::TagSet &tags, const std::string &schema, bool usingGoldDatabase) diff --git a/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.h b/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.h index 1d14df7d..f82adae7 100755 --- a/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.h +++ b/game/server/application/SwgDatabaseServer/src/shared/buffers/ObjvarBuffer.h @@ -60,7 +60,7 @@ public: NetworkId m_objectId; int m_nameId; - IndexKey(const NetworkId &objectId, int nameId); + IndexKey(const NetworkId objectId, int nameId); bool operator==(const IndexKey &rhs) const; bool operator<(const IndexKey &rhs) const; }; @@ -92,9 +92,7 @@ public: // ====================================================================== -inline ObjvarBuffer::IndexKey::IndexKey(const NetworkId &objectId, int nameId) : - m_objectId(objectId), - m_nameId(nameId) +inline ObjvarBuffer::IndexKey::IndexKey(const NetworkId objectId, int nameId) : m_objectId(objectId), m_nameId(nameId) { } diff --git a/game/server/application/SwgDatabaseServer/src/shared/core/SwgSnapshot.cpp b/game/server/application/SwgDatabaseServer/src/shared/core/SwgSnapshot.cpp index f81f75ad..ea1b4ee3 100755 --- a/game/server/application/SwgDatabaseServer/src/shared/core/SwgSnapshot.cpp +++ b/game/server/application/SwgDatabaseServer/src/shared/core/SwgSnapshot.cpp @@ -139,7 +139,9 @@ SwgSnapshot::SwgSnapshot(DB::ModeQuery::Mode mode, bool useGoldDatabase) : // ---------------------------------------------------------------------- -SwgSnapshot::~SwgSnapshot(){} +SwgSnapshot::~SwgSnapshot(){ + +} // ----------------------------------------------------------------------