We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e62837 commit 7327507Copy full SHA for 7327507
peer/conn.go
@@ -143,9 +143,10 @@ func (c *Conn) init() error {
143
}
144
})
145
c.rtc.OnConnectionStateChange(func(pcs webrtc.PeerConnectionState) {
146
- if c.isClosed() {
147
- return
148
- }
+ // Close must be locked here otherwise log output can appear
+ // after the connection has been closed.
+ c.closeMutex.Lock()
149
+ defer c.closeMutex.Unlock()
150
151
c.opts.Logger.Debug(context.Background(), "rtc connection updated",
152
slog.F("state", pcs),
0 commit comments