SL-15061 Crash at LLConversationItemSession::clearAndDeparentModels #3

master
Andrey Kleshchev 2024-08-19 22:59:48 +03:00 committed by Andrey Kleshchev
parent 169599fd2f
commit 342eee5038
1 changed files with 12 additions and 0 deletions

View File

@ -112,6 +112,18 @@ LLFloaterIMContainer::~LLFloaterIMContainer()
{
LLIMMgr::getInstance()->removeSessionObserver(this);
}
for (auto& session : mConversationsItems)
{
LLConversationItemSession* session_model = dynamic_cast<LLConversationItemSession*>(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)