summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicevivox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoicevivox.cpp')
-rw-r--r--[-rwxr-xr-x]indra/newview/llvoicevivox.cpp37
1 files changed, 22 insertions, 15 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 4dc9edb247..ada577d1b2 100755..100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -392,7 +392,7 @@ LLVivoxVoiceClient::~LLVivoxVoiceClient()
{
}
-//----------------------------------------------
+//---------------------------------------------------
void LLVivoxVoiceClient::init(LLPumpIO *pump)
{
@@ -406,7 +406,8 @@ void LLVivoxVoiceClient::terminate()
{
logout();
connectorShutdown();
- closeSocket(); // Need to do this now -- bad things happen if the destructor does it later.
+ closeSocket(); // Need to do this now -- bad things happen if the destructor does it later.
+ cleanUp();
}
else
{
@@ -414,6 +415,18 @@ void LLVivoxVoiceClient::terminate()
}
}
+//---------------------------------------------------
+
+void LLVivoxVoiceClient::cleanUp()
+{
+ deleteAllSessions();
+ deleteAllBuddies();
+ deleteAllVoiceFonts();
+ deleteVoiceFontTemplates();
+}
+
+//---------------------------------------------------
+
const LLVoiceVersionInfo& LLVivoxVoiceClient::getVersion()
{
return mVoiceVersion;
@@ -782,14 +795,10 @@ void LLVivoxVoiceClient::stateMachine()
{
//MARK: stateDisableCleanup
case stateDisableCleanup:
- // Clean up and reset everything.
+ // Clean up and reset everything.
closeSocket();
- deleteAllSessions();
- deleteAllBuddies();
- deleteAllVoiceFonts();
- deleteVoiceFontTemplates();
+ cleanUp();
- mConnectorHandle.clear();
mAccountHandle.clear();
mAccountPassword.clear();
mVoiceAccountServerURI.clear();
@@ -1681,12 +1690,9 @@ void LLVivoxVoiceClient::stateMachine()
//MARK: stateLoggedOut
case stateLoggedOut: // logout response received
- // Once we're logged out, all these things are invalid.
+ // Once we're logged out, these things are invalid.
mAccountHandle.clear();
- deleteAllSessions();
- deleteAllBuddies();
- deleteAllVoiceFonts();
- deleteVoiceFontTemplates();
+ cleanUp();
if(mVoiceEnabled && !mRelogRequested)
{
@@ -1784,6 +1790,8 @@ void LLVivoxVoiceClient::closeSocket(void)
{
mSocket.reset();
mConnected = false;
+ mConnectorHandle.clear();
+ mAccountHandle.clear();
}
void LLVivoxVoiceClient::loginSendMessage()
@@ -2376,8 +2384,7 @@ void LLVivoxVoiceClient::giveUp()
{
// All has failed. Clean up and stop trying.
closeSocket();
- deleteAllSessions();
- deleteAllBuddies();
+ cleanUp();
setState(stateJail);
}