File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,8 @@ func Test_Interceptor_BindUnbind(t *testing.T) {
187187 }
188188 }()
189189
190- closePairNow (t , sender , receiver )
190+ assert .NoError (t , sender .GracefulClose ())
191+ assert .NoError (t , receiver .GracefulClose ())
191192
192193 // Bind/UnbindLocal/RemoteStream should be called from one side.
193194 if cnt := atomic .LoadUint32 (& cntBindLocalStream ); cnt != 1 {
Original file line number Diff line number Diff line change @@ -2209,8 +2209,6 @@ func (pc *PeerConnection) close(shouldGracefullyClose bool) error {
22092209 // https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close (step #3)
22102210 pc .signalingState .Set (SignalingStateClosed )
22112211
2212- closeErrs = append (closeErrs , pc .api .interceptor .Close ())
2213-
22142212 // https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close (step #4)
22152213 pc .mu .Lock ()
22162214 for _ , t := range pc .rtpTransceivers {
@@ -2247,6 +2245,9 @@ func (pc *PeerConnection) close(shouldGracefullyClose bool) error {
22472245
22482246 closeErrs = append (closeErrs , doGracefulCloseOps ()... )
22492247
2248+ // Interceptor closes at the end to prevent Bind from being called after interceptor is closed
2249+ closeErrs = append (closeErrs , pc .api .interceptor .Close ())
2250+
22502251 return util .FlattenErrs (closeErrs )
22512252}
22522253
You can’t perform that action at this time.
0 commit comments