fixed addess of delete iterator

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8437 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-06-14 12:54:01 +00:00
parent c4a33eb0e0
commit 7172e7cd35

View File

@ -100,9 +100,20 @@ QIcon ChatLobbyUserNotify::getMainIcon(bool hasNew)
unsigned int ChatLobbyUserNotify::getNewCount() unsigned int ChatLobbyUserNotify::getNewCount()
{ {
int iNum=0; int iNum=0;
for (lobby_map::iterator itCL=_listMsg.begin(); itCL!=_listMsg.end(); ++itCL) { for (lobby_map::iterator itCL=_listMsg.begin(); itCL!=_listMsg.end();)
iNum+=itCL->second.size(); {
if (itCL->second.size()==0) _listMsg.erase(itCL); iNum+=itCL->second.size();
if (itCL->second.size()==0)
{
lobby_map::iterator ittmp = itCL ;
++ittmp ;
_listMsg.erase(itCL);
itCL = ittmp ;
}
else
++itCL ;
} }
return iNum; return iNum;
} }