Skip to content

Commit a49914b

Browse files
committed
Revert "Run ops.GracefulClose earlier in pc.Close"
This reverts commit 887b10f.
1 parent cef1db8 commit a49914b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

peerconnection.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2113,7 +2113,6 @@ func (pc *PeerConnection) close(shouldGracefullyClose bool) error {
21132113
}
21142114
if shouldGracefullyClose && !alreadyGracefullyClosed {
21152115
defer close(pc.isGracefulClosedDone)
2116-
pc.ops.GracefulClose()
21172116
}
21182117

21192118
// https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close (step #3)
@@ -2170,6 +2169,8 @@ func (pc *PeerConnection) close(shouldGracefullyClose bool) error {
21702169
pc.updateConnectionState(pc.ICEConnectionState(), pc.dtlsTransport.State())
21712170

21722171
if shouldGracefullyClose {
2172+
pc.ops.GracefulClose()
2173+
21732174
// note that it isn't canon to stop gracefully
21742175
pc.sctpTransport.lock.Lock()
21752176
for _, d := range pc.sctpTransport.dataChannels {

0 commit comments

Comments
 (0)