Core/Tickets: Fix crash in TicketMgr::ResetTickets()

This commit is contained in:
Elron103
2013-10-03 16:57:25 +02:00
parent 586df8d417
commit 2b7f29fef2

View File

@@ -257,9 +257,17 @@ void TicketMgr::Initialize()
void TicketMgr::ResetTickets()
{
for (GmTicketList::const_iterator itr = _ticketList.begin(); itr != _ticketList.end(); ++itr)
for (GmTicketList::const_iterator itr = _ticketList.begin(); itr != _ticketList.end();)
{
if (itr->second->IsClosed())
sTicketMgr->RemoveTicket(itr->second->GetId());
{
uint32 ticketId = itr->second->GetId();
++itr;
sTicketMgr->RemoveTicket(ticketId);
}
else
++itr;
}
_lastTicketId = 0;