summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llvoicevivox.cpp15
-rwxr-xr-xindra/newview/llvoicevivox.h1
2 files changed, 12 insertions, 4 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index efe4f15b00..642c6c1f76 100755
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -323,6 +323,7 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() :
mCaptureBufferRecording(false),
mCaptureBufferRecorded(false),
mCaptureBufferPlaying(false),
+ mShutdownComplete(true),
mPlayRequestCount(0),
mAvatarNameCacheConnection()
@@ -377,7 +378,14 @@ void LLVivoxVoiceClient::terminate()
if(mConnected)
{
logout();
- connectorShutdown();
+ connectorShutdown();
+ int count=0;
+ while (!mShutdownComplete && 10 > count++)
+ {
+ stateMachine();
+ _sleep(1000);
+ }
+
closeSocket(); // Need to do this now -- bad things happen if the destructor does it later.
cleanUp();
}
@@ -512,6 +520,7 @@ void LLVivoxVoiceClient::connectorShutdown()
<< "</Request>"
<< "\n\n\n";
+ mShutdownComplete = false;
mConnectorHandle.clear();
writeString(stream.str());
@@ -1564,6 +1573,7 @@ void LLVivoxVoiceClient::stateMachine()
//MARK: stateConnectorStopping
case stateConnectorStopping: // waiting for connector stop
// The handler for the Connector.InitiateShutdown response will transition from here to stateConnectorStopped.
+ mShutdownComplete = true;
break;
//MARK: stateConnectorStopped
@@ -1643,9 +1653,6 @@ void LLVivoxVoiceClient::stateMachine()
void LLVivoxVoiceClient::closeSocket(void)
{
-#ifdef LL_WINDOWS
- _sleep(3000); //Wait a moment for socket to close.
-#endif
mSocket.reset();
mConnected = false;
mConnectorHandle.clear();
diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h
index 10ebac730d..a4ec9f2a69 100755
--- a/indra/newview/llvoicevivox.h
+++ b/indra/newview/llvoicevivox.h
@@ -723,6 +723,7 @@ private:
bool mRenderDeviceDirty;
bool mIsInitialized;
+ bool mShutdownComplete;
bool checkParcelChanged(bool update = false);