From a34d9a07af17cb8a08744d9bd466e1bb23a21601 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 14 Jun 2015 10:09:08 +0000 Subject: [PATCH] fixed bug in using invalid iterator in ChatLobbyNotify git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8433 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- .../src/gui/chat/ChatLobbyUserNotify.cpp | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp b/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp index fe61d0c46..00e1e2216 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp @@ -127,22 +127,22 @@ void ChatLobbyUserNotify::iconClicked() for (lobby_map::iterator itCL=_listMsg.begin(); itCL!=_listMsg.end();) { - /// Create a menu per lobby /// - bool bFound=false; - QString strLobbyName=tr("Unknown Lobby"); - QIcon icoLobby=QIcon(); - std::list::const_iterator lobbyIt; - for (lobbyIt = lobbies.begin(); lobbyIt != lobbies.end(); ++lobbyIt) { - ChatLobbyId clId = *lobbyIt; - if (clId==itCL->first) { - ChatLobbyInfo clInfo; - if (rsMsgs->getChatLobbyInfo(clId,clInfo)) - strLobbyName=QString::fromUtf8(clInfo.lobby_name.c_str()) ; - icoLobby=(clInfo.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? QIcon(":/images/chat_red24.png") : QIcon(":/images/chat_x24.png"); - bFound=true; - break; - } - } + /// Create a menu per lobby /// + bool bFound=false; + QString strLobbyName=tr("Unknown Lobby"); + QIcon icoLobby=QIcon(); + std::list::const_iterator lobbyIt; + for (lobbyIt = lobbies.begin(); lobbyIt != lobbies.end(); ++lobbyIt) { + ChatLobbyId clId = *lobbyIt; + if (clId==itCL->first) { + ChatLobbyInfo clInfo; + if (rsMsgs->getChatLobbyInfo(clId,clInfo)) + strLobbyName=QString::fromUtf8(clInfo.lobby_name.c_str()) ; + icoLobby=(clInfo.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? QIcon(":/images/chat_red24.png") : QIcon(":/images/chat_x24.png"); + bFound=true; + break; + } + } if (bFound) { @@ -155,9 +155,9 @@ void ChatLobbyUserNotify::iconClicked() ++ittmp ; _listMsg.erase(itCL); itCL=ittmp ; - doUpdate=true; - } - } + doUpdate=true; + } + } if (notifyCombined()) { QSystemTrayIcon* trayIcon=getTrayIcon();