diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-02-23 04:18:03 +0200 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-06-25 18:39:09 -0700 |
commit | 39f0da7ab623ee99106058deb1d0c6a3295b567f (patch) | |
tree | 188c2681a6e156916518a7ba7e89b3ddf94874c1 /indra/newview/llconversationmodel.cpp | |
parent | 454821bb5968ce59e0738b38f135de659b8e349f (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.cpp | 26 |
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(); } |