Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 50e0c39f84b47a03b3c59b93d754936b6ba0ac89 1 parent 3610200
@jackpoz jackpoz authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/server/game/Battlegrounds/BattlegroundQueue.h
View
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
Please sign in to comment.
Something went wrong with that request. Please try again.