summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/llfolderviewitem.cpp18
-rw-r--r--indra/newview/llconversationmodel.cpp7
-rw-r--r--indra/newview/llconversationmodel.h1
3 files changed, 19 insertions, 7 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index e2b5279aab..16e9034430 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -181,14 +181,18 @@ LLFolderViewItem::~LLFolderViewItem()
BOOL LLFolderViewItem::postBuild()
{
- LLFolderViewModelItem& vmi = *getViewModelItem();
- // getDisplayName() is expensive (due to internal getLabelSuffix() and name building)
- // it also sets search strings so it requires a filter reset
- mLabel = vmi.getDisplayName();
- setToolTip(vmi.getName());
+ LLFolderViewModelItem* vmi = getViewModelItem();
+ llassert(vmi); // not supposed to happen, if happens, find out why and fix
+ if (vmi)
+ {
+ // getDisplayName() is expensive (due to internal getLabelSuffix() and name building)
+ // it also sets search strings so it requires a filter reset
+ mLabel = vmi->getDisplayName();
+ setToolTip(vmi->getName());
- // Dirty the filter flag of the model from the view (CHUI-849)
- vmi.dirtyFilter();
+ // Dirty the filter flag of the model from the view (CHUI-849)
+ vmi->dirtyFilter();
+ }
// Don't do full refresh on constructor if it is possible to avoid
// it significantly slows down bulk view creation.
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index 9ec4fb085b..9e043dbac0 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -90,6 +90,8 @@ LLConversationItem::~LLConversationItem()
{
mAvatarNameCacheConnection.disconnect();
}
+
+ clearChildren();
}
//virtual
@@ -254,6 +256,11 @@ LLConversationItemSession::LLConversationItemSession(const LLUUID& uuid, LLFolde
mConvType = CONV_SESSION_UNKNOWN;
}
+LLConversationItemSession::~LLConversationItemSession()
+{
+ clearAndDeparentModels();
+}
+
bool LLConversationItemSession::hasChildren() const
{
return getChildrenCount() > 0;
diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h
index 7c6980a7e6..07e60d7f62 100644
--- a/indra/newview/llconversationmodel.h
+++ b/indra/newview/llconversationmodel.h
@@ -156,6 +156,7 @@ class LLConversationItemSession : public LLConversationItem
public:
LLConversationItemSession(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model);
LLConversationItemSession(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model);
+ ~LLConversationItemSession();
/*virtual*/ bool hasChildren() const;
LLPointer<LLUIImage> getIcon() const { return NULL; }