Skip to content

Commit e0a7608

Browse files
committed
Have to use a coro for now, due to a http call.
1 parent 12ea8e4 commit e0a7608

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

indra/newview/llvoicewebrtc.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ void LLWebRTCVoiceClient::cleanupSingleton()
257257
mNextSession->shutdownAllConnections();
258258
}
259259
cleanUp();
260+
stopTimer();
260261
sessionState::clearSessions();
261262
}
262263

@@ -295,7 +296,6 @@ void LLWebRTCVoiceClient::cleanUp()
295296
mNeighboringRegions.clear();
296297
sessionState::for_each(boost::bind(predShutdownSession, _1));
297298
LL_DEBUGS("Voice") << "Exiting" << LL_ENDL;
298-
stopTimer();
299299
}
300300

301301
void LLWebRTCVoiceClient::stopTimer()
@@ -2478,7 +2478,7 @@ void LLVoiceWebRTCConnection::sendData(const std::string &data)
24782478

24792479
// Tell the simulator that we're shutting down a voice connection.
24802480
// 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)
24822482
{
24832483
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE;
24842484

@@ -2518,7 +2518,7 @@ void LLVoiceWebRTCConnection::breakVoiceConnection(connectionPtr_t connection)
25182518
body["voice_server_type"] = WEBRTC_VOICE_SERVER_TYPE;
25192519

25202520
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(
2521-
new LLCoreHttpUtil::HttpCoroutineAdapter("LLVoiceWebRTCAdHocConnection::breakVoiceConnection",
2521+
new LLCoreHttpUtil::HttpCoroutineAdapter("LLVoiceWebRTCAdHocConnection::breakVoiceConnectionCoro",
25222522
LLCore::HttpRequest::DEFAULT_POLICY_ID));
25232523
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
25242524
LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
@@ -2820,7 +2820,9 @@ bool LLVoiceWebRTCConnection::connectionStateMachine()
28202820
if (!LLWebRTCVoiceClient::isShuttingDown())
28212821
{
28222822
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()));
28242826
}
28252827
else
28262828
{

0 commit comments

Comments
 (0)