summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-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();