webrtc peer do not set nil conn.

This commit is contained in:
Miroslav Šedivý
2023-04-17 22:38:03 +02:00
parent 5a2fcc1c8a
commit 43f8fe339f
2 changed files with 3 additions and 6 deletions

View File

@ -487,7 +487,7 @@ func (manager *WebRTCManagerCtx) CreatePeer(session types.Session, bitrate int,
session.SetWebRTCConnected(peer, true)
case webrtc.PeerConnectionStateDisconnected,
webrtc.PeerConnectionStateFailed:
connection.Close()
peer.Destroy()
case webrtc.PeerConnectionStateClosed:
// ensure we only run this once
once.Do(func() {