diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index acec68f39321a80941e1705e42b6aaec3b2fede3..687b76c224ca7e5fef0952edcf9d9ece29fc8280 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1581,6 +1581,11 @@ bool LLAppViewer::doFrame()
 			saveFinalSnapshot();
 		}
 
+		if (LLVoiceClient::instanceExists())
+		{
+			LLVoiceClient::getInstance()->terminate();
+		}
+
 		delete gServicePump;
 
 		destroyMainloopTimeout();
@@ -1680,11 +1685,6 @@ bool LLAppViewer::cleanup()
     // Give any remaining SLPlugin instances a chance to exit cleanly.
     LLPluginProcessParent::shutdown();
 
-	if (LLVoiceClient::instanceExists())
-	{
-		LLVoiceClient::getInstance()->terminate();
-	}
-
 	disconnectViewer();
 
 	LL_INFOS() << "Viewer disconnected" << LL_ENDL;
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 6a3242b43fad00ca3741584170096b967a2a02c1..1676f70b1e2d9e635999d043682d4533c761876c 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -542,6 +542,10 @@ void LLVivoxVoiceClient::connectorShutdown()
 		
 		writeString(stream.str());
 	}
+	else
+	{
+		mShutdownComplete = true;
+	}
 }
 
 void LLVivoxVoiceClient::userAuthorized(const std::string& user_id, const LLUUID &agentID)
@@ -1046,16 +1050,25 @@ bool LLVivoxVoiceClient::breakVoiceConnection(bool corowait)
         retval = result.has("connector");
     }
     else
-    {   // If we are not doing a corowait then we must sleep until the connector has responded
+    {
+        mRelogRequested = false; //stop the control coro
+        // If we are not doing a corowait then we must sleep until the connector has responded
         // otherwise we may very well close the socket too early.
 #if LL_WINDOWS
-        int count = 0;
-        while (!mShutdownComplete && 10 > count++)
-        {   // Rider: This comes out to a max wait time of 10 seconds.  
-            // The situation that brings us here is a call from ::terminate() 
-            // and so the viewer is attempting to go away.  Don't slow it down 
-            // longer than this.
+        if (!mShutdownComplete)
+        {
+            // The situation that brings us here is a call from ::terminate()
+            // At this point message system is already down so we can't wait for
+            // the message, yet we need to receive "connector shutdown response".
+            // Either wait a bit and emulate it or check gMessageSystem for specific message
             _sleep(1000);
+            if (mConnected)
+            {
+                mConnected = false;
+                LLSD vivoxevent(LLSDMap("connector", LLSD::Boolean(false)));
+                LLEventPumps::instance().post("vivoxClientPump", vivoxevent);
+            }
+            mShutdownComplete = true;
         }
 #endif
     }
@@ -3243,6 +3256,7 @@ void LLVivoxVoiceClient::connectorShutdownResponse(int statusCode, std::string &
 	}
 	
 	mConnected = false;
+	mShutdownComplete = true;
 	
     LLSD vivoxevent(LLSDMap("connector", LLSD::Boolean(false)));