mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -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
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user