From 6833efe12e9555b7416e12063c6586805047eaff Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sat, 14 May 2011 17:07:22 +0400 Subject: [PATCH] [11486] Revert recent changes in BattleGroundMgr::DeleteAllBattleGrounds Reason added in comment to code line. --- src/game/BattleGroundMgr.cpp | 8 ++++++-- src/shared/revision_nr.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index bf3f48c67..e8cdc90a1 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -1143,8 +1143,12 @@ void BattleGroundMgr::DeleteAllBattleGrounds() // will also delete template bgs: for(uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; ++i) { - for(BattleGroundSet::iterator itr = m_BattleGrounds[i].begin(); itr != m_BattleGrounds[i].end(); ++itr) - delete itr->second; + for(BattleGroundSet::iterator itr = m_BattleGrounds[i].begin(); itr != m_BattleGrounds[i].end();) + { + BattleGround * bg = itr->second; + ++itr; // step from invalidate iterator pos in result element remove in ~BattleGround call + delete bg; + } } } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 6236a986f..81b969836 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11485" + #define REVISION_NR "11486" #endif // __REVISION_NR_H__