capture stream remove listeners on shutdown.

This commit is contained in:
Miroslav Šedivý 2021-02-28 18:56:04 +01:00
parent 2204400282
commit 8f9ad2cd9b

View File

@ -64,6 +64,12 @@ func streamNew(codec codec.RTPCodec, pipelineStr func() string) *StreamManagerCt
func (manager *StreamManagerCtx) shutdown() { func (manager *StreamManagerCtx) shutdown() {
manager.logger.Info().Msgf("shutting down") manager.logger.Info().Msgf("shutting down")
manager.emitMu.Lock()
for key := range manager.listeners {
delete(manager.listeners, key)
}
manager.emitMu.Unlock()
manager.destroyPipeline() manager.destroyPipeline()
manager.emitStop <- true manager.emitStop <- true
} }