Other: Fix double close on event channels

This commit is contained in:
Leander Beernaert
2022-12-22 11:06:21 +01:00
parent 9539b24d64
commit e3a1482b8f

View File

@ -109,9 +109,12 @@ func (c *eventCollector) getEventCh(ofType events.Event) <-chan events.Event {
}
func (c *eventCollector) close() {
c.lock.Lock()
defer c.lock.Unlock()
c.wg.Wait()
for _, eventCh := range c.events {
eventCh.CloseAndDiscardQueued()
}
c.events = nil
}