fixed bug in using invalid iterator in ChatLobbyNotify

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8432 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-06-14 09:57:45 +00:00
parent 31492c2f3a
commit f53f451596

View File

@ -125,7 +125,8 @@ void ChatLobbyUserNotify::iconClicked()
rsMsgs->getChatLobbyList(lobbies); rsMsgs->getChatLobbyList(lobbies);
bool doUpdate=false; bool doUpdate=false;
for (lobby_map::iterator itCL=_listMsg.begin(); itCL!=_listMsg.end();++itCL) { for (lobby_map::iterator itCL=_listMsg.begin(); itCL!=_listMsg.end();)
{
/// Create a menu per lobby /// /// Create a menu per lobby ///
bool bFound=false; bool bFound=false;
QString strLobbyName=tr("Unknown Lobby"); QString strLobbyName=tr("Unknown Lobby");
@ -143,10 +144,17 @@ void ChatLobbyUserNotify::iconClicked()
} }
} }
if (bFound){ if (bFound)
makeSubMenu(trayMenu, icoLobby, strLobbyName, itCL->first); {
} else { makeSubMenu(trayMenu, icoLobby, strLobbyName, itCL->first);
_listMsg.erase(itCL); ++itCL ;
}
else
{
lobby_map::iterator ittmp(itCL);
++ittmp ;
_listMsg.erase(itCL);
itCL=ittmp ;
doUpdate=true; doUpdate=true;
} }
} }