From 342eee503865af8ee193a1d04f0bc80712c5d80c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 19 Aug 2024 22:59:48 +0300 Subject: SL-15061 Crash at LLConversationItemSession::clearAndDeparentModels #3 --- indra/newview/llfloaterimcontainer.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 08e13276b3..f43f403755 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -112,6 +112,18 @@ LLFloaterIMContainer::~LLFloaterIMContainer() { LLIMMgr::getInstance()->removeSessionObserver(this); } + + for (auto& session : mConversationsItems) + { + LLConversationItemSession* session_model = dynamic_cast(session.second.get()); + if (session_model) + { + // Models have overcomplicated double ownership, clear + // and resolve '0 references' ownership now, before owned + // part of the models gets deleted by their owners + session_model->clearAndDeparentModels(); + } + } } void LLFloaterIMContainer::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id, bool has_offline_msg) -- cgit v1.2.3