mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-09 17:45:15 -04:00
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:
parent
c4a33eb0e0
commit
7172e7cd35
1 changed files with 14 additions and 3 deletions
|
@ -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();
|
iNum+=itCL->second.size();
|
||||||
if (itCL->second.size()==0) _listMsg.erase(itCL);
|
|
||||||
|
if (itCL->second.size()==0)
|
||||||
|
{
|
||||||
|
lobby_map::iterator ittmp = itCL ;
|
||||||
|
++ittmp ;
|
||||||
|
|
||||||
|
_listMsg.erase(itCL);
|
||||||
|
itCL = ittmp ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
++itCL ;
|
||||||
}
|
}
|
||||||
return iNum;
|
return iNum;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue