summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationmodel.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-02-23 04:18:03 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-02-23 19:18:13 +0200
commit5dcc0606a8512159660c652cb25e7f29292f2df0 (patch)
tree9566f92e9b2d4089e6ae18f9268878eff5e1a4ca /indra/newview/llconversationmodel.cpp
parent31af3d2b20f910f29747ddda10d31b05219532bd (diff)
Issue#880 Crash on a dead pointer in a chat session
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 9ec4fb085b..fe5428d7f5 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -353,22 +353,20 @@ void LLConversationItemSession::clearParticipants()
void LLConversationItemSession::clearAndDeparentModels()
{
- std::for_each(mChildren.begin(), mChildren.end(),
- [](LLFolderViewModelItem* c)
+ for (LLFolderViewModelItem* child : mChildren)
+ {
+ if (child->getNumRefs() == 0)
+ {
+ // LLConversationItemParticipant can be created but not assigned to any view,
+ // it was waiting for an "add_participant" event to be processed
+ delete child;
+ }
+ else
{
- 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);
- }
+ // Model is still assigned to some view/widget
+ child->setParent(NULL);
}
- );
+ }
mChildren.clear();
}