summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2014-04-14 18:57:29 +0300
committerandreykproductengine <akleshchev@productengine.com>2014-04-14 18:57:29 +0300
commitfd2a114d4ba0edb3bdfb73fff1e455be3ec079ed (patch)
treea957c0021674db134b35965c82e7b2baccff7774
parent4eeff34c6514160b3abefce35cee5f0e4e8cf1de (diff)
MAINT-1642 FIXED Viewer crashes on double-click on RegionCapabilityRequestError in Notifications Console
-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 4f35c325a8..e33f528c3b 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;