mirror of
https://github.com/m1k1o/neko.git
synced 2025-08-03 08:50:13 +02:00
fix deadlock.
This commit is contained in:
parent
6bd46b438e
commit
137614c087
3 changed files with 15 additions and 29 deletions
|
@ -68,14 +68,9 @@ func (peer *WebRTCPeerCtx) Destroy() {
|
|||
peer.mu.Lock()
|
||||
defer peer.mu.Unlock()
|
||||
|
||||
if peer.connection == nil || peer.connection.ConnectionState() != webrtc.PeerConnectionStateConnected {
|
||||
return
|
||||
if peer.connection != nil {
|
||||
err := peer.connection.Close()
|
||||
peer.logger.Err(err).Msg("peer connection destroyed")
|
||||
peer.connection = nil
|
||||
}
|
||||
|
||||
// TODO: Send webrtc disconnect event via websocket.
|
||||
|
||||
err := peer.connection.Close()
|
||||
peer.logger.Err(err).Msg("peer connection destroyed")
|
||||
|
||||
peer.connection = nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue