@@ -257,6 +257,7 @@ void LLWebRTCVoiceClient::cleanupSingleton()
257
257
mNextSession ->shutdownAllConnections ();
258
258
}
259
259
cleanUp ();
260
+ stopTimer ();
260
261
sessionState::clearSessions ();
261
262
}
262
263
@@ -295,7 +296,6 @@ void LLWebRTCVoiceClient::cleanUp()
295
296
mNeighboringRegions .clear ();
296
297
sessionState::for_each (boost::bind (predShutdownSession, _1));
297
298
LL_DEBUGS (" Voice" ) << " Exiting" << LL_ENDL;
298
- stopTimer ();
299
299
}
300
300
301
301
void LLWebRTCVoiceClient::stopTimer ()
@@ -2478,7 +2478,7 @@ void LLVoiceWebRTCConnection::sendData(const std::string &data)
2478
2478
2479
2479
// Tell the simulator that we're shutting down a voice connection.
2480
2480
// The simulator will pass this on to the Secondlife WebRTC server.
2481
- void LLVoiceWebRTCConnection::breakVoiceConnection (connectionPtr_t connection)
2481
+ void LLVoiceWebRTCConnection::breakVoiceConnectionCoro (connectionPtr_t connection)
2482
2482
{
2483
2483
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE;
2484
2484
@@ -2518,7 +2518,7 @@ void LLVoiceWebRTCConnection::breakVoiceConnection(connectionPtr_t connection)
2518
2518
body[" voice_server_type" ] = WEBRTC_VOICE_SERVER_TYPE;
2519
2519
2520
2520
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter (
2521
- new LLCoreHttpUtil::HttpCoroutineAdapter (" LLVoiceWebRTCAdHocConnection::breakVoiceConnection " ,
2521
+ new LLCoreHttpUtil::HttpCoroutineAdapter (" LLVoiceWebRTCAdHocConnection::breakVoiceConnectionCoro " ,
2522
2522
LLCore::HttpRequest::DEFAULT_POLICY_ID));
2523
2523
LLCore::HttpRequest::ptr_t httpRequest (new LLCore::HttpRequest);
2524
2524
LLCore::HttpOptions::ptr_t httpOpts (new LLCore::HttpOptions);
@@ -2820,7 +2820,9 @@ bool LLVoiceWebRTCConnection::connectionStateMachine()
2820
2820
if (!LLWebRTCVoiceClient::isShuttingDown ())
2821
2821
{
2822
2822
mOutstandingRequests ++;
2823
- breakVoiceConnection (this ->shared_from_this ());
2823
+ setVoiceConnectionState (VOICE_STATE_WAIT_FOR_EXIT);
2824
+ LLCoros::getInstance ()->launch (" LLVoiceWebRTCConnection::breakVoiceConnectionCoro" ,
2825
+ boost::bind (&LLVoiceWebRTCConnection::breakVoiceConnectionCoro, this ->shared_from_this ()));
2824
2826
}
2825
2827
else
2826
2828
{
0 commit comments