summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-08-13 22:45:33 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-08-13 22:48:40 +0300
commitf9c587535035b3a945edcff4ac09ab22ec4dbde2 (patch)
treef198da0c364714ec03b25750a1a5efbedd5404b9 /indra
parent12836d5f9154ea9c76fd5e74bc4460af4691ae89 (diff)
SL-15292 waitForChannel crash
This code needs to be turned into a state machine (switch-case between states) with clean exit and each state clean and separate. Right now it passes through all stages on exit and relies onto multiple bools instead of just transitioning to 'exit' state. In some cases coroutine still lives longer than voice singletone, it also needs to be adressed.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llvoicevivox.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index e4d528ece5..e6da5c5939 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -1880,13 +1880,22 @@ bool LLVivoxVoiceClient::waitForChannel()
break;
}
- } while (mVoiceEnabled && !mRelogRequested && !sShuttingDown);
+ } while (!sShuttingDown && mVoiceEnabled && !mRelogRequested);
- LL_DEBUGS("Voice")
- << "leaving inner waitForChannel loop"
- << " RelogRequested=" << mRelogRequested
- << " VoiceEnabled=" << mVoiceEnabled
- << LL_ENDL;
+ if (!sShuttingDown)
+ {
+ LL_DEBUGS("Voice")
+ << "leaving inner waitForChannel loop"
+ << " RelogRequested=" << mRelogRequested
+ << " VoiceEnabled=" << mVoiceEnabled
+ << LL_ENDL;
+ }
+ else
+ {
+ // if sShuttingDown is set, we already logged out
+ LL_DEBUGS("Voice") << "leaving inner waitForChannel loop." << LL_ENDL;
+ return false;
+ }
mIsProcessingChannels = false;
@@ -1902,7 +1911,7 @@ bool LLVivoxVoiceClient::waitForChannel()
return false;
}
}
- } while (mVoiceEnabled && mRelogRequested && isGatewayRunning() && !sShuttingDown);
+ } while (!sShuttingDown && mVoiceEnabled && mRelogRequested && isGatewayRunning());
LL_DEBUGS("Voice")
<< "exiting"