diff options
author | Richard Linden <none@none> | 2011-03-01 19:50:05 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2011-03-01 19:50:05 -0800 |
commit | 397c772505402422eafee5ec27b741d8bd030c8b (patch) | |
tree | 07a600e7c676fd351e4e15622e64f46822860e30 /indra/llui | |
parent | 2c9cd5f4b24ea88e6c83d55cec2122593d2810f7 (diff) |
SOCIAL-618 FIX Move UI hint not being shown in Minimal skin
duplicate suppression will now properly delete extra notifications, fixing memory leak
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llnotifications.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index cc9edfcdea..89614e6d12 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -1217,12 +1217,14 @@ bool LLNotifications::failedUniquenessTest(const LLSD& payload) { LLNotificationPtr pNotif = LLNotifications::instance().find(payload["id"].asUUID()); - if (!pNotif || !pNotif->hasUniquenessConstraints()) + if (!pNotif) { return false; } - // checks against existing unique notifications + // Update the existing unique notification with the data from this particular instance... + // This guarantees that duplicate notifications will be collapsed to the one + // most recently triggered for (LLNotificationMap::iterator existing_it = mUniqueNotifications.find(pNotif->getName()); existing_it != mUniqueNotifications.end(); ++existing_it) @@ -1235,7 +1237,7 @@ bool LLNotifications::failedUniquenessTest(const LLSD& payload) // of this unique notification and update it existing_notification->updateFrom(pNotif); // then delete the new one - pNotif->cancel(); + cancel(pNotif); } } @@ -1300,9 +1302,8 @@ void LLNotifications::createDefaultChannels() // usage LLStopWhenHandled combiner in LLStandardSignal LLNotifications::instance().getChannel("Unique")-> connectAtFrontChanged(boost::bind(&LLNotifications::uniqueHandler, this, _1)); -// failedUniquenessTest slot isn't necessary -// LLNotifications::instance().getChannel("Unique")-> -// connectFailedFilter(boost::bind(&LLNotifications::failedUniquenessTest, this, _1)); + LLNotifications::instance().getChannel("Unique")-> + connectFailedFilter(boost::bind(&LLNotifications::failedUniquenessTest, this, _1)); LLNotifications::instance().getChannel("Ignore")-> connectFailedFilter(&handleIgnoredNotification); LLNotifications::instance().getChannel("VisibilityRules")-> @@ -1578,7 +1579,7 @@ void LLNotifications::add(const LLNotificationPtr pNotif) void LLNotifications::cancel(LLNotificationPtr pNotif) { - if (pNotif == NULL) return; + if (pNotif == NULL || pNotif->isCancelled()) return; LLNotificationSet::iterator it=mItems.find(pNotif); if (it == mItems.end()) @@ -1680,7 +1681,6 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n) for(it = mVisibilityRules.begin(); it != mVisibilityRules.end(); it++) { // An empty type/tag/name string will match any notification, so only do the comparison when the string is non-empty in the rule. - lldebugs << "notification \"" << n->getName() << "\" " << "testing against " << ((*it)->mVisible?"show":"hide") << " rule, " @@ -1728,7 +1728,7 @@ bool LLNotifications::isVisibleByRules(LLNotificationPtr n) // Response property is empty. Cancel this notification. lldebugs << "cancelling notification " << n->getName() << llendl; - n->cancel(); + cancel(n); } else { |