1
0
Fork 0
forked from External/mediamtx

api: fix crash when changing settings of an on-demand source that is idle (#3246) (#3249)

This commit is contained in:
Alessandro Ros 2024-04-15 17:44:54 +02:00 committed by GitHub
parent 1c135fb62e
commit 95f1f79b35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 4 deletions

View file

@ -224,10 +224,18 @@ func (s *staticSourceHandler) run() {
}
func (s *staticSourceHandler) reloadConf(newConf *conf.Path) {
select {
case s.chReloadConf <- newConf:
case <-s.ctx.Done():
ctx := s.ctx
if !s.running {
return
}
go func() {
select {
case s.chReloadConf <- newConf:
case <-ctx.Done():
}
}()
}
// APISourceDescribe instanceements source.