summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaternotificationsconsole.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2014-11-05 10:52:23 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2014-11-05 10:52:23 -0500
commit13b4909a3ca066105695afc174642409daa46df2 (patch)
treef12b1c2d32fda122bcd1f6f79ebfe2226325d9a8 /indra/newview/llfloaternotificationsconsole.cpp
parent52ed6ac28697ffcfd7300602aec34db8eafc171a (diff)
parent02e2235277a90f2e291557a429ae4e5de3e0d3b6 (diff)
merge
Diffstat (limited to 'indra/newview/llfloaternotificationsconsole.cpp')
-rwxr-xr-xindra/newview/llfloaternotificationsconsole.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp
index c21e4ff7e8..fd03efa061 100755
--- a/indra/newview/llfloaternotificationsconsole.cpp
+++ b/indra/newview/llfloaternotificationsconsole.cpp
@@ -41,6 +41,7 @@ class LLNotificationChannelPanel : public LLLayoutPanel
{
public:
LLNotificationChannelPanel(const Params& p);
+ ~LLNotificationChannelPanel();
BOOL postBuild();
private:
@@ -57,6 +58,20 @@ LLNotificationChannelPanel::LLNotificationChannelPanel(const LLNotificationChann
buildFromFile( "panel_notifications_channel.xml");
}
+LLNotificationChannelPanel::~LLNotificationChannelPanel()
+{
+ // Userdata for all records is a LLNotification* we need to clean up
+ std::vector<LLScrollListItem*> data_list = getChild<LLScrollListCtrl>("notifications_list")->getAllData();
+ std::vector<LLScrollListItem*>::iterator data_itor;
+ for (data_itor = data_list.begin(); data_itor != data_list.end(); ++data_itor)
+ {
+ LLScrollListItem* item = *data_itor;
+ LLNotification* notification = (LLNotification*)item->getUserdata();
+ delete notification;
+ notification = NULL;
+ }
+}
+
BOOL LLNotificationChannelPanel::postBuild()
{
LLButton* header_button = getChild<LLButton>("header");
@@ -124,7 +139,7 @@ bool LLNotificationChannelPanel::update(const LLSD& payload)
row["columns"][2]["type"] = "date";
LLScrollListItem* sli = getChild<LLScrollListCtrl>("notifications_list")->addElement(row);
- sli->setUserdata(&(*notification));
+ sli->setUserdata(new LLNotification(notification->asLLSD()));
}
return false;