summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-12-17 20:16:33 -0800
committerMerov Linden <merov@lindenlab.com>2012-12-17 20:16:33 -0800
commitc2d332a89cb29d54df40f1f120304d871278fb76 (patch)
tree9102fe977dfe35767fd009af6f8cdd9607a9d190 /indra/llui
parent3d137bae5c5435dde305323179d8d3d6c9720bad (diff)
CHUI-580 : WIP : Added disconnect of callbacks once they're called to prevent filling up the callback queue
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llnotifications.cpp2
-rw-r--r--indra/llui/llurlentry.cpp8
2 files changed, 8 insertions, 2 deletions
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 6b00225605..8fb7a9d864 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -1827,6 +1827,8 @@ void LLPostponedNotification::fetchAvatarName(const LLUUID& id)
void LLPostponedNotification::onAvatarNameCache(const LLUUID& agent_id,
const LLAvatarName& av_name)
{
+ mAvatarNameCacheConnection.disconnect();
+
std::string name = av_name.getCompleteName();
// from PE merge - we should figure out if this is the right thing to do
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 1758218b7d..99ee688888 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -372,7 +372,9 @@ void LLUrlEntryAgent::callObservers(const std::string &id,
void LLUrlEntryAgent::onAvatarNameCache(const LLUUID& id,
const LLAvatarName& av_name)
{
- std::string label = av_name.getCompleteName();
+ mAvatarNameCacheConnection.disconnect();
+
+ std::string label = av_name.getCompleteName();
// received the agent name from the server - tell our observers
callObservers(id.asString(), label, mIcon);
@@ -525,6 +527,8 @@ LLUrlEntryAgentName::LLUrlEntryAgentName() :
void LLUrlEntryAgentName::onAvatarNameCache(const LLUUID& id,
const LLAvatarName& av_name)
{
+ mAvatarNameCacheConnection.disconnect();
+
std::string label = getName(av_name);
// received the agent name from the server - tell our observers
callObservers(id.asString(), label, mIcon);
@@ -562,7 +566,7 @@ std::string LLUrlEntryAgentName::getLabel(const std::string &url, const LLUrlLab
{
mAvatarNameCacheConnection.disconnect();
}
- mAvatarNameCacheConnection = LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgentCompleteName::onAvatarNameCache, this, _1, _2));
+ mAvatarNameCacheConnection = LLAvatarNameCache::get(agent_id, boost::bind(&LLUrlEntryAgentName::onAvatarNameCache, this, _1, _2));
addObserver(agent_id_string, url, cb);
return LLTrans::getString("LoadingData");
}