summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationmodel.cpp
diff options
context:
space:
mode:
authorEuclid Linden <euclid@lindenlab.com>2021-04-29 18:23:44 +0000
committerEuclid Linden <euclid@lindenlab.com>2021-04-29 18:23:44 +0000
commit5e757b2841941e8e5a9b918dbae4fd7b36a84896 (patch)
treedeee2618a9c33681e038845605db6719babd1d77 /indra/newview/llconversationmodel.cpp
parent18316191cd7d1e1f8c3a4940eb5ed6cdf2695575 (diff)
parent2386125ae0db3218c620667b05449cd25ee05ad5 (diff)
Merged in DV525-merge-6.4.19 (pull request #559)
DRTVWR-525 merge up to 6.4.19
Diffstat (limited to 'indra/newview/llconversationmodel.cpp')
-rw-r--r--indra/newview/llconversationmodel.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index 27b1f3d20a..a685639427 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -341,11 +341,36 @@ void LLConversationItemSession::removeParticipant(const LLUUID& participant_id)
void LLConversationItemSession::clearParticipants()
{
+ // clearParticipants function potentially is malfunctioning since it only cleans children of models,
+ // it does nothing to views that own those models (listeners)
+ // probably needs to post some kind of 'remove all participants' event
clearChildren();
mIsLoaded = false;
mNeedsRefresh = true;
}
+
+void LLConversationItemSession::clearAndDeparentModels()
+{
+ std::for_each(mChildren.begin(), mChildren.end(),
+ [](LLFolderViewModelItem* c)
+ {
+ if (c->getNumRefs() == 0)
+ {
+ // LLConversationItemParticipant can be created but not assigned to any view,
+ // it was waiting for an "add_participant" event to be processed
+ delete c;
+ }
+ else
+ {
+ // Model is still assigned to some view/widget
+ c->setParent(NULL);
+ }
+ }
+ );
+ mChildren.clear();
+}
+
LLConversationItemParticipant* LLConversationItemSession::findParticipant(const LLUUID& participant_id)
{
// This is *not* a general tree parsing algorithm. It assumes that a session contains only