summaryrefslogtreecommitdiff
path: root/indra/newview/llpathfindingobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpathfindingobject.cpp')
-rw-r--r--indra/newview/llpathfindingobject.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/indra/newview/llpathfindingobject.cpp b/indra/newview/llpathfindingobject.cpp
index 916eceb4c8..39fc3903b4 100644
--- a/indra/newview/llpathfindingobject.cpp
+++ b/indra/newview/llpathfindingobject.cpp
@@ -55,6 +55,7 @@ LLPathfindingObject::LLPathfindingObject()
mOwnerUUID(),
mHasOwnerName(false),
mOwnerName(),
+ mAvatarNameCacheConnection(),
mIsGroupOwned(false),
mLocation()
{
@@ -67,6 +68,7 @@ LLPathfindingObject::LLPathfindingObject(const std::string &pUUID, const LLSD &p
mOwnerUUID(),
mHasOwnerName(false),
mOwnerName(),
+ mAvatarNameCacheConnection(),
mIsGroupOwned(false),
mLocation()
{
@@ -80,6 +82,7 @@ LLPathfindingObject::LLPathfindingObject(const LLPathfindingObject& pOther)
mOwnerUUID(pOther.mOwnerUUID),
mHasOwnerName(false),
mOwnerName(),
+ mAvatarNameCacheConnection(),
mIsGroupOwned(pOther.mIsGroupOwned),
mLocation(pOther.mLocation)
{
@@ -88,6 +91,7 @@ LLPathfindingObject::LLPathfindingObject(const LLPathfindingObject& pOther)
LLPathfindingObject::~LLPathfindingObject()
{
+ disconnectAvatarNameCacheConnection();
}
LLPathfindingObject &LLPathfindingObject::operator =(const LLPathfindingObject& pOther)
@@ -149,7 +153,7 @@ void LLPathfindingObject::fetchOwnerName()
mHasOwnerName = LLAvatarNameCache::get(mOwnerUUID, &mOwnerName);
if (!mHasOwnerName)
{
- LLAvatarNameCache::get(mOwnerUUID, boost::bind(&LLPathfindingObject::handleAvatarNameFetch, this, _1, _2));
+ mAvatarNameCacheConnection = LLAvatarNameCache::get(mOwnerUUID, boost::bind(&LLPathfindingObject::handleAvatarNameFetch, this, _1, _2));
}
}
}
@@ -159,4 +163,13 @@ void LLPathfindingObject::handleAvatarNameFetch(const LLUUID &pOwnerUUID, const
llassert(mOwnerUUID == pOwnerUUID);
mOwnerName = pAvatarName;
mHasOwnerName = true;
+ disconnectAvatarNameCacheConnection();
+}
+
+void LLPathfindingObject::disconnectAvatarNameCacheConnection()
+{
+ if (mAvatarNameCacheConnection.connected())
+ {
+ mAvatarNameCacheConnection.disconnect();
+ }
}