summaryrefslogtreecommitdiff
path: root/indra/newview/llnamelistctrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llnamelistctrl.cpp')
-rw-r--r--indra/newview/llnamelistctrl.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp
index 855007e403..7f396b7b7e 100644
--- a/indra/newview/llnamelistctrl.cpp
+++ b/indra/newview/llnamelistctrl.cpp
@@ -64,7 +64,8 @@ LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p)
mNameColumnIndex(p.name_column.column_index),
mNameColumn(p.name_column.column_name),
mAllowCallingCardDrop(p.allow_calling_card_drop),
- mShortNames(p.short_names)
+ mShortNames(p.short_names),
+ mAvatarNameCacheConnection()
{}
// public
@@ -327,9 +328,13 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow(
else
{
// ...schedule a callback
- LLAvatarNameCache::get(id,
- boost::bind(&LLNameListCtrl::onAvatarNameCache,
- this, _1, _2, item->getHandle()));
+ // This is not correct and will likely lead to partially populated lists in cases where avatar names are not cached.
+ // *TODO : Change this to have 2 callbacks : one callback per list item and one for the whole list.
+ if (mAvatarNameCacheConnection.connected())
+ {
+ mAvatarNameCacheConnection.disconnect();
+ }
+ mAvatarNameCacheConnection = LLAvatarNameCache::get(id,boost::bind(&LLNameListCtrl::onAvatarNameCache,this, _1, _2, item->getHandle()));
}
break;
}
@@ -388,6 +393,8 @@ void LLNameListCtrl::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name,
LLHandle<LLNameListItem> item)
{
+ mAvatarNameCacheConnection.disconnect();
+
std::string name;
if (mShortNames)
name = av_name.getDisplayName();