mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
destroy only if is WebRTC active.
This commit is contained in:
parent
feb07b97ab
commit
22407825fe
@ -123,11 +123,12 @@ func (session *SessionCtx) SetWebSocketConnected(connected bool) {
|
|||||||
session.manager.emmiter.Emit("disconnected", session)
|
session.manager.emmiter.Emit("disconnected", session)
|
||||||
session.websocket_peer = nil
|
session.websocket_peer = nil
|
||||||
|
|
||||||
// TODO: Refactor. Only if is WebRTC active.
|
if session.webrtc_peer != nil {
|
||||||
if err := session.webrtc_peer.Destroy(); err != nil {
|
if err := session.webrtc_peer.Destroy(); err != nil {
|
||||||
session.logger.Warn().Err(err).Msgf("webrtc destroy has failed")
|
session.logger.Warn().Err(err).Msgf("webrtc destroy has failed")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (session *SessionCtx) Send(v interface{}) error {
|
func (session *SessionCtx) Send(v interface{}) error {
|
||||||
if session.websocket_peer == nil {
|
if session.websocket_peer == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user