diff options
Diffstat (limited to 'indra/newview/llconversationmodel.cpp')
-rw-r--r-- | indra/newview/llconversationmodel.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 4aa74a550c..fbdf08d8aa 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -341,11 +341,28 @@ void LLConversationItemSession::removeParticipant(const LLUUID& participant_id) void LLConversationItemSession::clearParticipants() { + // clearParticipants function potentially is malfunctioning since it only cleans children of models, + // it does nothing to views that own those models (listeners) + // probably needs to post some kind of 'remove all participants' event clearChildren(); mIsLoaded = false; mNeedsRefresh = true; } + +void LLConversationItemSession::deleteParticipantModels() +{ + // Make sure that no views exist before use and that view-owned items were removed! + // + // Normally we are not supposed to delete models directly, they should be + // owned by views and this action will result in crashes, but LLParticipantList + // creates models separately from views (it probably shouldn't) and then those + // models wait for idle cycles to be assigned to view. + // this code is meant to delete 'waiting' models + std::for_each(mChildren.begin(), mChildren.end(), DeletePointer()); + mChildren.clear(); +} + LLConversationItemParticipant* LLConversationItemSession::findParticipant(const LLUUID& participant_id) { // This is *not* a general tree parsing algorithm. It assumes that a session contains only |