summaryrefslogtreecommitdiff
path: root/indra/llui/llnotifications.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2010-08-18 12:16:29 -0700
committerRichard Linden <none@none>2010-08-18 12:16:29 -0700
commit3aa8148ed94bcf495784efe51ad9d466d566868d (patch)
tree0da4bcfc2d0fe5606fb2a783e7f68be88e7811fd /indra/llui/llnotifications.cpp
parent87d9a34ab869a6e31d83cae8cc55beaebc0c7ff9 (diff)
fix for occasional crash when dismissing hint
Diffstat (limited to 'indra/llui/llnotifications.cpp')
-rw-r--r--indra/llui/llnotifications.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 2da8f1eb1b..7cc6e8e8f6 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1425,17 +1425,26 @@ void LLNotifications::cancel(LLNotificationPtr pNotif)
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 = next_it, ++next_it)
+ ++it)
{
LLNotificationPtr pNotif = *it;
if (pNotif->getName() == name)
{
- pNotif->cancel();
- updateItem(LLSD().with("sigtype", "delete").with("id", pNotif->id()), pNotif);
+ notifs_to_cancel.push_back(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)