summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicevivox.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2021-04-30 03:04:47 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2021-04-30 03:04:47 +0300
commit0fa5fc47a2069a2c151536baa917b9c6978480e4 (patch)
tree2964096f28a6a5e7f08e5a0aa83f2ffe76d42421 /indra/newview/llvoicevivox.cpp
parent498b72aacd6d10dfcd4f15e1d16532dc138f0461 (diff)
parentce65bc2f13409d75dbc6502c970030cc5ed2e5ad (diff)
Merge branch 'master' into DRTVWR-527-maint
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 a8d668420e..f9ffefd4a2 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;
}
//---------------------------------------------------
@@ -953,10 +954,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
@@ -969,8 +975,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);
@@ -993,6 +1001,11 @@ bool LLVivoxVoiceClient::provisionVoiceAccount()
// *TODO* Pump a message for wake up.
llcoro::suspend();
}
+
+ if (sShuttingDown)
+ {
+ return false;
+ }
std::string url = gAgent.getRegionCapability("ProvisionVoiceAccountRequest");