diff options
author | Merov Linden <merov@lindenlab.com> | 2012-12-17 18:59:01 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2012-12-17 18:59:01 -0800 |
commit | 6fe7144104cd8b5bd9c7d215f76afdeafe13b7ee (patch) | |
tree | c4f7f5d9b0f03c5beae32ca0f234d1fd4f4d326b /indra/newview/llimview.cpp | |
parent | 0e4c3070cb6cfb389d708ca459ed2c721c1cc28a (diff) |
CHUI-580 : WIP : Protect callback connections passed to LLAvatarNameCache::get() where necessary
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r-- | indra/newview/llimview.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 4e2ac09dd8..d3569694f1 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -253,7 +253,8 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& mTextIMPossible(true), mOtherParticipantIsAvatar(true), mStartCallOnInitialize(false), - mStartedAsIMCall(voice) + mStartedAsIMCall(voice), + mAvatarNameCacheConnection() { // set P2P type by default mSessionType = P2P_SESSION; @@ -334,9 +335,7 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& // history files have consistent (English) names in different locales. if (isAdHocSessionType() && IM_SESSION_INVITE == mType) { - LLAvatarNameCache::get(mOtherParticipantID, - boost::bind(&LLIMModel::LLIMSession::onAdHocNameCache, - this, _2)); + mAvatarNameCacheConnection = LLAvatarNameCache::get(mOtherParticipantID,boost::bind(&LLIMModel::LLIMSession::onAdHocNameCache,this, _2)); } } @@ -450,6 +449,11 @@ void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::ES LLIMModel::LLIMSession::~LLIMSession() { + if (mAvatarNameCacheConnection.connected()) + { + mAvatarNameCacheConnection.disconnect(); + } + delete mSpeakers; mSpeakers = NULL; @@ -2056,7 +2060,8 @@ BOOL LLOutgoingCallDialog::postBuild() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LLIncomingCallDialog::LLIncomingCallDialog(const LLSD& payload) : -LLCallDialog(payload) +LLCallDialog(payload), +mAvatarNameCacheConnection() { } @@ -2126,9 +2131,11 @@ BOOL LLIncomingCallDialog::postBuild() else { // Get the full name information - LLAvatarNameCache::get(caller_id, - boost::bind(&LLIncomingCallDialog::onAvatarNameCache, - this, _1, _2, call_type)); + if (mAvatarNameCacheConnection.connected()) + { + mAvatarNameCacheConnection.disconnect(); + } + mAvatarNameCacheConnection = LLAvatarNameCache::get(caller_id, boost::bind(&LLIncomingCallDialog::onAvatarNameCache, this, _1, _2, call_type)); } setIcon(session_id, caller_id); |