summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicevivox.cpp
diff options
context:
space:
mode:
authorCallum Prentice <callum@lindenlab.com>2021-04-29 13:38:16 -0700
committerCallum Prentice <callum@lindenlab.com>2021-04-29 13:38:16 -0700
commite3721fe66e2472eaf6bffd4bf4e2b9ec5edd2506 (patch)
tree32f6b6d4fabd10f447a0c950e0bafe7b573e4d9b /indra/newview/llvoicevivox.cpp
parent0ccb0306da93fa279909f45131009e80687f2f3d (diff)
parentce65bc2f13409d75dbc6502c970030cc5ed2e5ad (diff)
Merge remote-tracking branch 'origin/master' into DRTVWR-533
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rw-r--r--indra/newview/llvoicevivox.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index f2115feb10..96ae171eb7 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -391,7 +391,7 @@ LLVivoxVoiceClient::~LLVivoxVoiceClient()
void LLVivoxVoiceClient::init(LLPumpIO *pump)
{
// constructor will set up LLVoiceClient::getInstance()
- LLVivoxVoiceClient::getInstance()->mPump = pump;
+ mPump = pump;
// LLCoros::instance().launch("LLVivoxVoiceClient::voiceControlCoro",
// boost::bind(&LLVivoxVoiceClient::voiceControlCoro, LLVivoxVoiceClient::getInstance()));
@@ -419,6 +419,7 @@ void LLVivoxVoiceClient::terminate()
}
sShuttingDown = true;
+ mPump = NULL;
}
//---------------------------------------------------
@@ -963,10 +964,15 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
llcoro::suspendUntilTimeout(UPDATE_THROTTLE_SECONDS);
- while (!mPump)
- { // Can't do this until we have the pump available.
+ while (!mPump && !sShuttingDown)
+ { // Can't use the pump until we have it available.
llcoro::suspend();
}
+
+ if (sShuttingDown)
+ {
+ return false;
+ }
// MBW -- Note to self: pumps and pipes examples in
// indra/test/io.cpp
@@ -979,8 +985,10 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
readChain.push_back(LLIOPipe::ptr_t(new LLIOSocketReader(mSocket)));
readChain.push_back(LLIOPipe::ptr_t(new LLVivoxProtocolParser()));
+
mPump->addChain(readChain, NEVER_CHAIN_EXPIRY_SECS);
+
//---------------------------------------------------------------------
llcoro::suspendUntilTimeout(UPDATE_THROTTLE_SECONDS);
@@ -1003,6 +1011,11 @@ bool LLVivoxVoiceClient::provisionVoiceAccount()
// *TODO* Pump a message for wake up.
llcoro::suspend();
}
+
+ if (sShuttingDown)
+ {
+ return false;
+ }
std::string url = gAgent.getRegionCapability("ProvisionVoiceAccountRequest");