From ffb5770f77bb7303577d32bcbdc1dea637f47d8c Mon Sep 17 00:00:00 2001 From: Simon Cousineau Date: Fri, 2 Feb 2024 16:59:32 +0000 Subject: [PATCH] Close peerconnection ice gatherer on close --- peerconnection.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/peerconnection.go b/peerconnection.go index c6af120097e..bc71deddcc3 100644 --- a/peerconnection.go +++ b/peerconnection.go @@ -2083,7 +2083,12 @@ func (pc *PeerConnection) Close() error { // https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close (step #7) closeErrs = append(closeErrs, pc.dtlsTransport.Stop()) - // https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close (step #8, #9, #10) + // https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close (step #8) + if pc.iceGatherer != nil { + closeErrs = append(closeErrs, pc.iceGatherer.Close()) + } + + // https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close (step #9, #10) if pc.iceTransport != nil { closeErrs = append(closeErrs, pc.iceTransport.Stop()) }