From 9241a87b6fae9785b9a9557104e5329aefdd70b5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 23 Jun 2021 18:32:57 +0300 Subject: SL-15292 waitForChannel crash #2 --- indra/newview/llvoicevivox.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 8dd061728f..c383750f60 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -1583,6 +1583,12 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession) { result = llcoro::suspendUntilEventOnWithTimeout(mVivoxPump, SESSION_JOIN_TIMEOUT, timeoutResult); + if (sShuttingDown) + { + mIsJoiningSession = false; + return false; + } + LL_INFOS("Voice") << "event=" << ll_stream_notation_sd(result) << LL_ENDL; if (result.has("session")) { @@ -1821,7 +1827,7 @@ bool LLVivoxVoiceClient::waitForChannel() // the parcel is changed, or we have no pending audio sessions, // so try to request the parcel voice info // if we have the cap, we move to the appropriate state - requestParcelVoiceInfo(); + requestParcelVoiceInfo(); //suspends for http reply } else if (sessionNeedsRelog(mNextAudioSession)) { @@ -1833,7 +1839,7 @@ bool LLVivoxVoiceClient::waitForChannel() { sessionStatePtr_t joinSession = mNextAudioSession; mNextAudioSession.reset(); - if (!runSession(joinSession)) + if (!runSession(joinSession)) //suspends { LL_DEBUGS("Voice") << "runSession returned false; leaving inner loop" << LL_ENDL; break; @@ -1848,7 +1854,7 @@ bool LLVivoxVoiceClient::waitForChannel() } } - if (!mNextAudioSession) + if (!mNextAudioSession && !sShuttingDown) { llcoro::suspendUntilTimeout(1.0); } @@ -1921,7 +1927,12 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session) while (mVoiceEnabled && isGatewayRunning() && !mSessionTerminateRequested && !mTuningMode) { - sendCaptureAndRenderDevices(); + sendCaptureAndRenderDevices(); // suspends + if (mSessionTerminateRequested) + { + break; + } + if (mAudioSession && mAudioSession->mParticipantsChanged) { mAudioSession->mParticipantsChanged = false; -- cgit v1.2.3