Skip to content
Snippets Groups Projects
Commit 3aa8148e authored by Richard Linden's avatar Richard Linden
Browse files

fix for occasional crash when dismissing hint

parent 87d9a34a
No related branches found
No related tags found
No related merge requests found
...@@ -1425,17 +1425,26 @@ void LLNotifications::cancel(LLNotificationPtr pNotif) ...@@ -1425,17 +1425,26 @@ void LLNotifications::cancel(LLNotificationPtr pNotif)
void LLNotifications::cancelByName(const std::string& name) void LLNotifications::cancelByName(const std::string& name)
{ {
for (LLNotificationSet::iterator it=mItems.begin(), end_it = mItems.end(), next_it = it; std::vector<LLNotificationPtr> notifs_to_cancel;
for (LLNotificationSet::iterator it=mItems.begin(), end_it = mItems.end();
it != end_it; it != end_it;
it = next_it, ++next_it) ++it)
{ {
LLNotificationPtr pNotif = *it; LLNotificationPtr pNotif = *it;
if (pNotif->getName() == name) if (pNotif->getName() == name)
{ {
pNotif->cancel(); notifs_to_cancel.push_back(pNotif);
updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif);
} }
} }
for (std::vector<LLNotificationPtr>::iterator it = notifs_to_cancel.begin(), end_it = notifs_to_cancel.end();
it != end_it;
++it)
{
LLNotificationPtr pNotif = *it;
pNotif->cancel();
updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif);
}
} }
void LLNotifications::update(const LLNotificationPtr pNotif) void LLNotifications::update(const LLNotificationPtr pNotif)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment