Browse files

Core/Battlegrounds: Fix invalidated iterator crash

Partially revert e1bee86 and restore 9ba3d07 to store battleground queues as std::list instead of std::deque because deque::erase() invalidates all iterators.
  • Loading branch information...
1 parent 3610200 commit 50e0c39f84b47a03b3c59b93d754936b6ba0ac89 @jackpoz jackpoz committed Feb 23, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/server/game/Battlegrounds/BattlegroundQueue.h
4 src/server/game/Battlegrounds/BattlegroundQueue.h
@@ -88,8 +88,8 @@ class BattlegroundQueue
typedef std::map<uint64, PlayerQueueInfo> QueuedPlayersMap;
QueuedPlayersMap m_QueuedPlayers;
- //we need constant add to begin and constant remove / add from the end, therefore deque suits our problem well
- typedef std::deque<GroupQueueInfo*> GroupsQueueType;
+ //do NOT use deque because deque.erase() invalidates ALL iterators
+ typedef std::list<GroupQueueInfo*> GroupsQueueType;
This two dimensional array is used to store All queued groups

0 comments on commit 50e0c39

Please sign in to comment.