summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterreporter.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-12-17 18:59:01 -0800
committerMerov Linden <merov@lindenlab.com>2012-12-17 18:59:01 -0800
commit6fe7144104cd8b5bd9c7d215f76afdeafe13b7ee (patch)
treec4f7f5d9b0f03c5beae32ca0f234d1fd4f4d326b /indra/newview/llfloaterreporter.cpp
parent0e4c3070cb6cfb389d708ca459ed2c721c1cc28a (diff)
CHUI-580 : WIP : Protect callback connections passed to LLAvatarNameCache::get() where necessary
Diffstat (limited to 'indra/newview/llfloaterreporter.cpp')
-rw-r--r--indra/newview/llfloaterreporter.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp
index cf2481f99a..79387747a5 100644
--- a/indra/newview/llfloaterreporter.cpp
+++ b/indra/newview/llfloaterreporter.cpp
@@ -103,7 +103,8 @@ LLFloaterReporter::LLFloaterReporter(const LLSD& key)
mPicking( FALSE),
mPosition(),
mCopyrightWarningSeen( FALSE ),
- mResourceDatap(new LLResourceData())
+ mResourceDatap(new LLResourceData()),
+ mAvatarNameCacheConnection()
{
}
@@ -187,6 +188,11 @@ BOOL LLFloaterReporter::postBuild()
// virtual
LLFloaterReporter::~LLFloaterReporter()
{
+ if (mAvatarNameCacheConnection.connected())
+ {
+ mAvatarNameCacheConnection.disconnect();
+ }
+
// child views automatically deleted
mObjectID = LLUUID::null;
@@ -313,7 +319,11 @@ void LLFloaterReporter::setFromAvatarID(const LLUUID& avatar_id)
std::string avatar_link = LLSLURL("agent", mObjectID, "inspect").getSLURLString();
getChild<LLUICtrl>("owner_name")->setValue(avatar_link);
- LLAvatarNameCache::get(avatar_id, boost::bind(&LLFloaterReporter::onAvatarNameCache, this, _1, _2));
+ if (mAvatarNameCacheConnection.connected())
+ {
+ mAvatarNameCacheConnection.disconnect();
+ }
+ mAvatarNameCacheConnection = LLAvatarNameCache::get(avatar_id, boost::bind(&LLFloaterReporter::onAvatarNameCache, this, _1, _2));
}
void LLFloaterReporter::onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name)