Close publishers/subscribers if proxy session is closed.

This commit is contained in:
Joachim Bauch
2021-08-10 09:24:59 +02:00
parent 6841d1495f
commit 4c77ae04ef
2 changed files with 18 additions and 4 deletions
+5 -2
View File
@@ -934,8 +934,11 @@ func (s *ProxyServer) DeleteSession(id uint64) {
}
func (s *ProxyServer) deleteSessionLocked(id uint64) {
delete(s.sessions, id)
statsSessionsCurrent.Dec()
if session, found := s.sessions[id]; found {
delete(s.sessions, id)
session.Close()
statsSessionsCurrent.Dec()
}
}
func (s *ProxyServer) StoreClient(id string, client signaling.McuClient) {