summaryrefslogtreecommitdiff
path: root/indra/newview/llspeakers.cpp
diff options
context:
space:
mode:
authorsimon <none@none>2014-10-24 12:23:26 -0700
committersimon <none@none>2014-10-24 12:23:26 -0700
commitd524c76822b020a2105c90b0bf0ba19ff90bc709 (patch)
tree7e4d30ab39576d377537d0021926869eaec075b0 /indra/newview/llspeakers.cpp
parent4f5ea39c9150f70977983de9b7e02b13f9b0dc6a (diff)
MAINT-4614 - fix viewer warning about bad membership list update
Diffstat (limited to 'indra/newview/llspeakers.cpp')
-rwxr-xr-xindra/newview/llspeakers.cpp24
1 files changed, 13 insertions, 11 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)