diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llcallfloater.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llspeakers.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llspeakers.h | 10 |
3 files changed, 18 insertions, 14 deletions
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index d405c1bbc1..97a5c3b8e2 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -678,8 +678,7 @@ void LLCallFloater::resetVoiceRemoveTimers() void LLCallFloater::removeVoiceRemoveTimer(const LLUUID& voice_speaker_id) { - bool delete_it = true; - mSpeakerDelayRemover->unsetActionTimer(voice_speaker_id, delete_it); + mSpeakerDelayRemover->unsetActionTimer(voice_speaker_id); } bool LLCallFloater::validateSpeaker(const LLUUID& speaker_id) diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 786fa24e65..717a8bda1e 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -175,6 +175,11 @@ BOOL LLSpeakerActionTimer::tick() return TRUE; } +void LLSpeakerActionTimer::unset() +{ + mActionCallback = 0; +} + LLSpeakersDelayActionsStorage::LLSpeakersDelayActionsStorage(LLSpeakerActionTimer::action_callback_t action_cb, F32 action_delay) : mActionCallback(action_cb) , mActionDelay(action_delay) @@ -205,7 +210,7 @@ void LLSpeakersDelayActionsStorage::setActionTimer(const LLUUID& speaker_id) } } -void LLSpeakersDelayActionsStorage::unsetActionTimer(const LLUUID& speaker_id, bool delete_it) +void LLSpeakersDelayActionsStorage::unsetActionTimer(const LLUUID& speaker_id) { if (mActionTimersMap.size() == 0) return; @@ -213,10 +218,7 @@ void LLSpeakersDelayActionsStorage::unsetActionTimer(const LLUUID& speaker_id, b if (it_speaker != mActionTimersMap.end()) { - if (delete_it) - { - delete it_speaker->second; - } + it_speaker->second->unset(); mActionTimersMap.erase(it_speaker); } } @@ -233,8 +235,7 @@ void LLSpeakersDelayActionsStorage::removeAllTimers() bool LLSpeakersDelayActionsStorage::onTimerActionCallback(const LLUUID& speaker_id) { - bool delete_it = false; // we're *in* this timer, return true to delete it, don't manually delete it - unsetActionTimer(speaker_id, delete_it); + unsetActionTimer(speaker_id); if (mActionCallback) { @@ -293,9 +294,7 @@ LLPointer<LLSpeaker> LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::strin } } - bool delete_it = true; - mSpeakerDelayRemover->unsetActionTimer(speakerp->mID, delete_it); - + mSpeakerDelayRemover->unsetActionTimer(speakerp->mID); return speakerp; } diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index ddc3632f07..9fa46d0650 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -155,6 +155,13 @@ public: */ virtual BOOL tick(); + /** + * Clears the callback. + * + * Use this instead of deleteing this object. + * The next call to tick() will return true and that will destroy this object. + */ + void unset(); private: action_callback_t mActionCallback; LLUUID mSpeakerId; @@ -180,7 +187,7 @@ public: * * @see onTimerActionCallback() */ - void unsetActionTimer(const LLUUID& speaker_id, bool delete_it); + void unsetActionTimer(const LLUUID& speaker_id); void removeAllTimers(); private: @@ -188,7 +195,6 @@ private: * Callback of the each instance of LLSpeakerActionTimer. * * Unsets an appropriate timer instance and calls action callback for specified speacker_id. - * It always returns false to not use LLEventTimer::updateClass functionality of timer deleting. * * @see unsetActionTimer() */ |