diff options
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llspeakers.cpp | 24 | ||||
-rwxr-xr-x | indra/newview/llspeakers.h | 2 |
2 files changed, 14 insertions, 12 deletions
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index e80756e4de..7867e1573c 100755 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -611,11 +611,14 @@ void LLSpeakerMgr::updateSpeakerList() setSpeaker(gAgentID, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT); } -void LLSpeakerMgr::setSpeakerNotInChannel(LLSpeaker* speakerp) +void LLSpeakerMgr::setSpeakerNotInChannel(LLPointer<LLSpeaker> speakerp) { - speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL; - speakerp->mDotColor = INACTIVE_COLOR; - mSpeakerDelayRemover->setActionTimer(speakerp->mID); + if (speakerp.notNull()) + { + speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL; + speakerp->mDotColor = INACTIVE_COLOR; + mSpeakerDelayRemover->setActionTimer(speakerp->mID); + } } bool LLSpeakerMgr::removeSpeaker(const LLUUID& speaker_id) @@ -795,7 +798,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update) if (agent_data.isMap() && agent_data.has("transition")) { - if (agent_data["transition"].asString() == "LEAVE" && speakerp.notNull()) + if (agent_data["transition"].asString() == "LEAVE") { setSpeakerNotInChannel(speakerp); } @@ -806,7 +809,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update) } else { - LL_WARNS() << "bad membership list update " << ll_print_sd(agent_data["transition"]) << LL_ENDL; + LL_WARNS() << "bad membership list update from 'agent_updates' for agent " << agent_id << ", transition " << ll_print_sd(agent_data["transition"]) << LL_ENDL; } } @@ -848,7 +851,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update) LLPointer<LLSpeaker> speakerp = findSpeaker(agent_id); std::string agent_transition = update_it->second.asString(); - if (agent_transition == "LEAVE" && speakerp.notNull()) + if (agent_transition == "LEAVE") { setSpeakerNotInChannel(speakerp); } @@ -859,8 +862,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update) } else { - LL_WARNS() << "bad membership list update " - << agent_transition << LL_ENDL; + LL_WARNS() << "bad membership list update from 'updates' for agent " << agent_id << ", transition " << agent_transition << LL_ENDL; } } } @@ -1041,8 +1043,8 @@ void LLLocalSpeakerMgr::updateSpeakerList() for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); ++speaker_it) { LLUUID speaker_id = speaker_it->first; - LLSpeaker* speakerp = speaker_it->second; - if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY) + LLPointer<LLSpeaker> speakerp = speaker_it->second; + if (speakerp.notNull() && speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY) { LLVOAvatar* avatarp = (LLVOAvatar*)gObjectList.findObject(speaker_id); if (!avatarp || dist_vec_squared(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > CHAT_NORMAL_RADIUS * CHAT_NORMAL_RADIUS) diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index e953dd0e1a..0e69184125 100755 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -258,7 +258,7 @@ public: protected: virtual void updateSpeakerList(); - void setSpeakerNotInChannel(LLSpeaker* speackerp); + void setSpeakerNotInChannel(LLPointer<LLSpeaker> speackerp); bool removeSpeaker(const LLUUID& speaker_id); typedef std::map<LLUUID, LLPointer<LLSpeaker> > speaker_map_t; |