diff options
author | Richard Linden <none@none> | 2010-08-18 12:16:29 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2010-08-18 12:16:29 -0700 |
commit | 3aa8148ed94bcf495784efe51ad9d466d566868d (patch) | |
tree | 0da4bcfc2d0fe5606fb2a783e7f68be88e7811fd /indra/llui | |
parent | 87d9a34ab869a6e31d83cae8cc55beaebc0c7ff9 (diff) |
fix for occasional crash when dismissing hint
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llnotifications.cpp | 17 |
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) |