From ddbd1ab47ea6cd76ed3e6bf32ffaeb73a32b4a97 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Sun, 19 May 2024 02:30:45 -0700 Subject: More session shutdown cleanup --- indra/llwebrtc/llwebrtc.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/llwebrtc') diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index c72841e9e5..14fb63ec2a 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -280,9 +280,15 @@ void LLWebRTCImpl::terminate() { connection->terminate(); } - mPeerConnections.clear(); + + // connection->terminate() above spawns a number of Signaling thread calls to + // shut down the connection. The following Blocking Call will wait + // until they're done before it's executed, allowing time to clean up. mSignalingThread->BlockingCall([this]() { mPeerConnectionFactory = nullptr; }); + + mPeerConnections.clear(); + mWorkerThread->BlockingCall( [this]() { @@ -652,7 +658,6 @@ LLWebRTCPeerConnectionImpl::LLWebRTCPeerConnectionImpl() : LLWebRTCPeerConnectionImpl::~LLWebRTCPeerConnectionImpl() { - terminate(); mSignalingObserverList.clear(); mDataObserverList.clear(); } -- cgit v1.2.3