summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMnikolenko ProductEngine <mnikolenko@productengine.com>2015-07-20 16:38:57 +0300
committerMnikolenko ProductEngine <mnikolenko@productengine.com>2015-07-20 16:38:57 +0300
commitda0f280ec3989789db4d502f4b34797c03dea9fa (patch)
treed639af7e088005502a357bc0876a9adb4a199774 /indra
parent8b498ab961f14cfb03834422c4b2b33a91f91f6e (diff)
MAINT-5414 FIXED Viewer crashes after opening Group info panel
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llnotificationlistitem.cpp28
-rw-r--r--indra/newview/llnotificationlistitem.h1
2 files changed, 19 insertions, 10 deletions
diff --git a/indra/newview/llnotificationlistitem.cpp b/indra/newview/llnotificationlistitem.cpp
index ddbc5f3916..67f3d0720f 100644
--- a/indra/newview/llnotificationlistitem.cpp
+++ b/indra/newview/llnotificationlistitem.cpp
@@ -337,6 +337,11 @@ LLGroupNoticeNotificationListItem::LLGroupNoticeNotificationListItem(const Param
buildFromFile("panel_notification_list_item.xml");
}
+LLGroupNoticeNotificationListItem::~LLGroupNoticeNotificationListItem()
+{
+ LLGroupMgr::getInstance()->removeObserver(this);
+}
+
BOOL LLGroupNoticeNotificationListItem::postBuild()
{
BOOL rv = LLGroupNotificationListItem::postBuild();
@@ -413,7 +418,8 @@ void LLGroupNotificationListItem::changed(LLGroupChange gc)
{
if (GC_PROPERTIES == gc)
{
- updateFromCache();
+ updateFromCache();
+ LLGroupMgr::getInstance()->removeObserver(this);
}
}
@@ -427,19 +433,20 @@ bool LLGroupNotificationListItem::updateFromCache()
void LLGroupNotificationListItem::setGroupId(const LLUUID& value)
{
- LLGroupMgr* gm = LLGroupMgr::getInstance();
- if (mGroupId.notNull())
+ LLGroupMgr* gm = LLGroupMgr::getInstance();
+ if (mGroupId.notNull())
{
gm->removeObserver(this);
- }
- mID = mGroupId;
- // Check if cache already contains image_id for that group
- if (!updateFromCache())
- {
- gm->addObserver(this);
- gm->sendGroupPropertiesRequest(mGroupId);
+ mID = mGroupId;
+
+ // Check if cache already contains image_id for that group
+ if (!updateFromCache())
+ {
+ gm->addObserver(this);
+ gm->sendGroupPropertiesRequest(mGroupId);
+ }
}
}
@@ -488,6 +495,7 @@ void LLGroupNoticeNotificationListItem::close()
mInventoryOffer->forceResponse(IOR_DECLINE);
mInventoryOffer = NULL;
}
+ LLGroupMgr::getInstance()->removeObserver(this);
}
void LLGroupNoticeNotificationListItem::onClickAttachment()
diff --git a/indra/newview/llnotificationlistitem.h b/indra/newview/llnotificationlistitem.h
index d00016fc15..86b1128de0 100644
--- a/indra/newview/llnotificationlistitem.h
+++ b/indra/newview/llnotificationlistitem.h
@@ -184,6 +184,7 @@ class LLGroupNoticeNotificationListItem
: public LLGroupNotificationListItem
{
public:
+ ~LLGroupNoticeNotificationListItem();
static std::set<std::string> getTypes();
virtual BOOL postBuild();