Skip to content

Commit 48a2e5a

Browse files
committed
Revert "Run ops.GracefulClose earlier in pc.Close"
This reverts commit ec6b6f1.
1 parent 130b6ae commit 48a2e5a

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
@@ -2123,7 +2123,6 @@ func (pc *PeerConnection) close(shouldGracefullyClose bool) error {
21232123
}
21242124
if shouldGracefullyClose && !alreadyGracefullyClosed {
21252125
defer close(pc.isGracefulClosedDone)
2126-
pc.ops.GracefulClose()
21272126
}
21282127

21292128
// https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close (step #3)
@@ -2180,6 +2179,8 @@ func (pc *PeerConnection) close(shouldGracefullyClose bool) error {
21802179
pc.updateConnectionState(pc.ICEConnectionState(), pc.dtlsTransport.State())
21812180

21822181
if shouldGracefullyClose {
2182+
pc.ops.GracefulClose()
2183+
21832184
// note that it isn't canon to stop gracefully
21842185
pc.sctpTransport.lock.Lock()
21852186
for _, d := range pc.sctpTransport.dataChannels {

0 commit comments

Comments
 (0)