From e1e25f9a0d8e8d6f7b89673183ca570854984685 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 26 Jun 2020 15:10:46 +0300 Subject: SL-13397 Reduce Viewer freeze when opening chat with a large group. --- indra/newview/llfloaterimsessiontab.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 3aee08482b..6d326f6850 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -465,9 +465,10 @@ void LLFloaterIMSessionTab::appendMessage(const LLChat& chat, const LLSD &args) } } - +static LLTrace::BlockTimerStatHandle FTM_BUILD_CONVERSATION_VIEW_PARTICIPANT("Build Conversation View"); void LLFloaterIMSessionTab::buildConversationViewParticipant() { + LL_RECORD_BLOCK_TIME(FTM_BUILD_CONVERSATION_VIEW_PARTICIPANT); // Clear the widget list since we are rebuilding afresh from the model conversations_widgets_map::iterator widget_it = mConversationsWidgets.begin(); while (widget_it != mConversationsWidgets.end()) @@ -496,14 +497,14 @@ void LLFloaterIMSessionTab::buildConversationViewParticipant() } } -void LLFloaterIMSessionTab::addConversationViewParticipant(LLConversationItem* participant_model) +void LLFloaterIMSessionTab::addConversationViewParticipant(LLConversationItem* participant_model, bool update_view) { // Check if the model already has an associated view LLUUID uuid = participant_model->getUUID(); LLFolderViewItem* widget = get_ptr_in_map(mConversationsWidgets,uuid); // If not already present, create the participant view and attach it to the root, otherwise, just refresh it - if (widget) + if (widget && update_view) { updateConversationViewParticipant(uuid); // overkill? } -- cgit v1.2.3 From ff077375b2185d95117237c19f211ffacc5c9608 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 13 Jul 2020 20:28:05 +0300 Subject: SL-13597 Crash in LLFloaterIMSessionTab::addConversationViewParticipant --- indra/newview/llfloaterimsessiontab.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterimsessiontab.cpp') diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 6d326f6850..d604d0a789 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -499,6 +499,12 @@ void LLFloaterIMSessionTab::buildConversationViewParticipant() void LLFloaterIMSessionTab::addConversationViewParticipant(LLConversationItem* participant_model, bool update_view) { + if (!participant_model) + { + // Nothing to do if the model is inexistent + return; + } + // Check if the model already has an associated view LLUUID uuid = participant_model->getUUID(); LLFolderViewItem* widget = get_ptr_in_map(mConversationsWidgets,uuid); @@ -525,8 +531,8 @@ void LLFloaterIMSessionTab::removeConversationViewParticipant(const LLUUID& part { mConversationsRoot->extractItem(widget); delete widget; - mConversationsWidgets.erase(participant_id); } + mConversationsWidgets.erase(participant_id); } void LLFloaterIMSessionTab::updateConversationViewParticipant(const LLUUID& participant_id) -- cgit v1.2.3