diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-08-13 16:55:51 -0700 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-08-13 16:55:51 -0700 |
commit | 7cbbdbd896d1e54d2d54cb4ec1ed5bd14491a629 (patch) | |
tree | c41167ff97919de923750a1479a39b4caea5efd5 /indra/newview/llpathfindingobject.cpp | |
parent | 1ace064a58daf5bc493ae1fe5a9180db89ea52dc (diff) |
PATH-849: CRASHFIX This should fix the crash caused by LLPathfindingObject::handleAvatarNameFetch being called after the corresponding LLPathfindingObject has been deleted.
Diffstat (limited to 'indra/newview/llpathfindingobject.cpp')
-rw-r--r-- | indra/newview/llpathfindingobject.cpp | 15 |
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(); + } } |