From 7172e7cd357ff869a5eee8bf493c5d2ab7d08eb6 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 14 Jun 2015 12:54:01 +0000 Subject: [PATCH] fixed addess of delete iterator git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8437 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- .../src/gui/chat/ChatLobbyUserNotify.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp b/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp index 00e1e2216..f8155b365 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp @@ -100,9 +100,20 @@ QIcon ChatLobbyUserNotify::getMainIcon(bool hasNew) unsigned int ChatLobbyUserNotify::getNewCount() { int iNum=0; - for (lobby_map::iterator itCL=_listMsg.begin(); itCL!=_listMsg.end(); ++itCL) { - iNum+=itCL->second.size(); - if (itCL->second.size()==0) _listMsg.erase(itCL); + for (lobby_map::iterator itCL=_listMsg.begin(); itCL!=_listMsg.end();) + { + iNum+=itCL->second.size(); + + if (itCL->second.size()==0) + { + lobby_map::iterator ittmp = itCL ; + ++ittmp ; + + _listMsg.erase(itCL); + itCL = ittmp ; + } + else + ++itCL ; } return iNum; }