summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRoxanne Skelly <roxie@lindenlab.com>2026-09-17 11:55:11 -0700
committerGitHub <noreply@github.com>2026-09-17 11:55:11 -0700
commit9bc42804f6f574d24467ee9f56e7e67d268f0c61 (patch)
treebc1ab710b100a9b3bbfbddbe78bca422e524eea2 /indra
parent31b0748d86f18904ff42c1b6b61553d993d625c7 (diff)
parent56d7fbfcea5a6e22cbce67eb6b5c2b1f73ac1d7e (diff)
Merge pull request #6335 from secondlife/roxie/fix-voice-reconnect
Voice wasn't automatically reconnecting after a voice server crash or restart
Diffstat (limited to 'indra')
-rw-r--r--indra/llwebrtc/llwebrtc.cpp23
-rw-r--r--indra/llwebrtc/llwebrtc_impl.h5
2 files changed, 17 insertions, 11 deletions
diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp
index 3b3e7ea3ba..87ed21291f 100644
--- a/indra/llwebrtc/llwebrtc.cpp
+++ b/indra/llwebrtc/llwebrtc.cpp
@@ -478,7 +478,7 @@ bool LLWebRTCImpl::terminate()
{
for (auto& connection : connections)
{
- connection->closeOnSignalingThread();
+ connection->closeOnSignalingThread(true);
}
// Destroy the connections here, on the signaling thread, while
// it's still running.
@@ -1146,13 +1146,13 @@ void LLWebRTCPeerConnectionImpl::terminate()
mWebRTCImpl->PostSignalingTask(
[self]()
{
- self->closeOnSignalingThread();
+ self->closeOnSignalingThread(false);
self->mPendingJobs--;
});
}
// Signaling thread only.
-void LLWebRTCPeerConnectionImpl::closeOnSignalingThread()
+void LLWebRTCPeerConnectionImpl::closeOnSignalingThread(bool webrtc_terminate)
{
// Stop issuing stats requests; one may already be in flight, and
// Close() below will flush it.
@@ -1203,13 +1203,16 @@ void LLWebRTCPeerConnectionImpl::closeOnSignalingThread()
observer->OnPeerConnectionClosed();
}
- // Nothing may call back into the viewer past this point. Connections
- // closed while the viewer is still running unset themselves as observers
- // when they're destroyed, but any that are left for llwebrtc::terminate()
- // to close deliberately don't -- they're torn down as soon as it returns,
- // so a late callback would be reaching into freed memory.
- mSignalingObserverList.clear();
- mDataObserverList.clear();
+ if (webrtc_terminate)
+ {
+ // Nothing may call back into the viewer past this point. Connections
+ // closed while the viewer is still running unset themselves as observers
+ // when they're destroyed, but any that are left for llwebrtc::terminate()
+ // to close deliberately don't -- they're torn down as soon as it returns,
+ // so a late callback would be reaching into freed memory.
+ mSignalingObserverList.clear();
+ mDataObserverList.clear();
+ }
}
void LLWebRTCPeerConnectionImpl::setSignalingObserver(LLWebRTCSignalingObserver *observer) { mSignalingObserverList.emplace_back(observer); }
diff --git a/indra/llwebrtc/llwebrtc_impl.h b/indra/llwebrtc/llwebrtc_impl.h
index ae3a6a4903..c980b28d6e 100644
--- a/indra/llwebrtc/llwebrtc_impl.h
+++ b/indra/llwebrtc/llwebrtc_impl.h
@@ -600,10 +600,13 @@ class LLWebRTCPeerConnectionImpl : public LLWebRTCPeerConnectionInterface,
void init(LLWebRTCImpl * webrtc_impl);
// Posts closeOnSignalingThread() and returns immediately.
void terminate();
+
// The actual close. Signaling thread only. Callable directly (via a
// BlockingCall) when the caller needs the connection to be fully closed
// before it continues -- see LLWebRTCImpl::terminate().
- void closeOnSignalingThread();
+ // webrtc_terminate indicates we're shutting down the webrtc library,
+ // if not, we'll be reusing the peer connection for a reconnection
+ void closeOnSignalingThread(bool webrtc_terminate);
virtual void AddRef() const override = 0;
virtual webrtc::RefCountReleaseStatus Release() const override = 0;