[11486] Revert recent changes in BattleGroundMgr::DeleteAllBattleGrounds

Reason added in comment to code line.
This commit is contained in:
VladimirMangos 2011-05-14 17:07:22 +04:00
parent c6b5064725
commit 6833efe12e
2 changed files with 7 additions and 3 deletions

View file

@ -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;
}
}
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11485"
#define REVISION_NR "11486"
#endif // __REVISION_NR_H__