From 3db4616e17c4f828ddcb75c0b74da1f3ed2563eb Mon Sep 17 00:00:00 2001 From: balrok Date: Wed, 17 Mar 2010 18:54:57 +0100 Subject: [PATCH] [9600] restored work of DeleteAllBattleGrounds --- src/game/BattleGroundMgr.cpp | 15 +++++++-------- src/shared/revision_nr.h | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index c0a842d92..fb4d9e5dd 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -1138,16 +1138,15 @@ BattleGroundMgr::~BattleGroundMgr() 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();) - delete itr->second; - - // destroy template battlegrounds that listed only in queues (other already terminated) - for(uint32 bgTypeId = 0; bgTypeId < MAX_BATTLEGROUND_TYPE_ID; ++bgTypeId) { - // ~BattleGround call unregistring BG from queue - while(!BGFreeSlotQueue[bgTypeId].empty()) - delete BGFreeSlotQueue[bgTypeId].front(); + for(BattleGroundSet::iterator itr = m_BattleGrounds[i].begin(); itr != m_BattleGrounds[i].end();) + { + BattleGround * bg = itr->second; + itr++; + delete bg; + } } } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 7e75f8bf1..0736bf6b4 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 "9599" + #define REVISION_NR "9600" #endif // __REVISION_NR_H__