summaryrefslogtreecommitdiff
path: root/indra/llwebrtc
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2024-05-02 11:07:36 -0700
committerRoxie Linden <roxie@lindenlab.com>2024-05-02 11:07:36 -0700
commit07c3095a785864b39b03d979d43b7d0d7a932a81 (patch)
tree07517bced047ae3f0fa2c6f08518c6b897be1146 /indra/llwebrtc
parentf9cb9a2b057b2ebc2e1f5cbf479e56595c0fdfb8 (diff)
Unregister requested data channel when using the negotiated one.
When creating a new connection, the viewer builds a data channel interface. It then gets a new one, which is a proxy. The viewer uses the new one, and therefore must unregister the callbacks from the old one. Also, update the position data before sending it after the join is sent.
Diffstat (limited to 'indra/llwebrtc')
-rw-r--r--indra/llwebrtc/llwebrtc.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp
index d07e6deea4..97c04ae446 100644
--- a/indra/llwebrtc/llwebrtc.cpp
+++ b/indra/llwebrtc/llwebrtc.cpp
@@ -957,6 +957,10 @@ void LLWebRTCPeerConnectionImpl::OnRemoveTrack(rtc::scoped_refptr<webrtc::RtpRec
void LLWebRTCPeerConnectionImpl::OnDataChannel(rtc::scoped_refptr<webrtc::DataChannelInterface> channel)
{
+ if (mDataChannel)
+ {
+ mDataChannel->UnregisterObserver();
+ }
mDataChannel = channel;
channel->RegisterObserver(this);
}