summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicewebrtc.h
diff options
context:
space:
mode:
authorRoxanne Skelly <roxie@lindenlab.com>2026-08-18 10:19:03 -0700
committerGitHub <noreply@github.com>2026-08-18 10:19:03 -0700
commitae3e2ee100b0166525b149aecbde5f68ebc683b2 (patch)
tree85261cda141a3b03f1b700e2bfd98170e33a2dd3 /indra/newview/llvoicewebrtc.h
parentb33d4053eca36480098f764c7b7ad8f3516641ea (diff)
parent66570c6e4690ead5f9b9be5ef5f35eadb87db327 (diff)
Merge pull request #6129 from secondlife/roxie/fix-webrtc-terminate
Fix shutdown crash and cut WebRTC teardown time
Diffstat (limited to 'indra/newview/llvoicewebrtc.h')
-rw-r--r--indra/newview/llvoicewebrtc.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h
index 818bce5bc3..ec01b8c08c 100644
--- a/indra/newview/llvoicewebrtc.h
+++ b/indra/newview/llvoicewebrtc.h
@@ -79,6 +79,12 @@ public:
static bool isShuttingDown() { return sShuttingDown; }
+ // True once llwebrtc::terminate() has been entered. Between
+ // isShuttingDown() and this, the webrtc library is still fully alive and
+ // connections must still release their peer connections normally -- see
+ // drainConnections() and ~LLVoiceWebRTCConnection().
+ static bool isWebRTCTerminated() { return sWebRTCTerminated; }
+
const LLVoiceVersionInfo& getVersion() override;
void updateVersion();
@@ -306,6 +312,9 @@ public:
bool isEmpty() { return mWebRTCConnections.empty(); }
+ bool allConnectionsClosed() const;
+ static bool allSessionsClosed();
+
virtual bool isSpatial() = 0;
virtual bool isEstate() = 0;
virtual bool isCallbackPossible() = 0;
@@ -455,6 +464,10 @@ private:
/// Clean up objects created during a voice session.
void cleanUp();
+ /// Close the live peer connections before handing off to
+ /// llwebrtc::terminate(). Bounded and best effort.
+ void drainConnections();
+
LL::WorkQueue::weak_t mMainQueue;
F32 mTuningMicGain;
@@ -539,6 +552,7 @@ private:
// These variables can last longer than WebRTC in coroutines so we need them as static
static bool sShuttingDown;
+ static bool sWebRTCTerminated;
LLEventMailDrop mWebRTCPump;
@@ -643,6 +657,12 @@ class LLVoiceWebRTCConnection :
return mShutDown;
}
+ // True once the webrtc peer connection has finished closing. The
+ // connection object can outlive this while it waits for outstanding
+ // requests to unwind, so this -- not reaping -- is what drainConnections()
+ // waits on.
+ bool isClosed() const { return mVoiceConnectionState == VOICE_STATE_CLOSED; }
+
void OnVoiceConnectionRequestSuccess(const LLSD &body);
void resetConnectionStats();