summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationmodel.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-08-28 20:47:43 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-08-28 20:47:43 -0400
commitcde1174345224d33d6b45b1e3243fa39043223e5 (patch)
tree6c8db6e0499622d8c7206a11c997eb173ebd478f /indra/newview/llconversationmodel.cpp
parent6f454ad8366ed33bbe199c3fc3ed69e6d3448cec (diff)
parent35efadf78315f9b351415930dca4fae251ef4dd0 (diff)
Merge branch 'main' into release/luau-scripting.
Diffstat (limited to 'indra/newview/llconversationmodel.cpp')
-rw-r--r--indra/newview/llconversationmodel.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index 4335168417..4cd85ac756 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -357,22 +357,20 @@ void LLConversationItemSession::clearParticipants()
void LLConversationItemSession::clearAndDeparentModels()
{
- std::for_each(mChildren.begin(), mChildren.end(),
- [](LLFolderViewModelItem* c)
+ for (LLFolderViewModelItem* child : mChildren)
+ {
+ if (child->getNumRefs() == 0)
{
- 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);
- }
+ // LLConversationItemParticipant can be created but not assigned to any view,
+ // it was waiting for an "add_participant" event to be processed
+ delete child;
}
- );
+ else
+ {
+ // Model is still assigned to some view/widget
+ child->setParent(NULL);
+ }
+ }
mChildren.clear();
}