forked from Silverfish/proton-bridge
Other: Fix double close on event channels
This commit is contained in:
@ -109,9 +109,12 @@ func (c *eventCollector) getEventCh(ofType events.Event) <-chan events.Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *eventCollector) close() {
|
func (c *eventCollector) close() {
|
||||||
|
c.lock.Lock()
|
||||||
|
defer c.lock.Unlock()
|
||||||
c.wg.Wait()
|
c.wg.Wait()
|
||||||
|
|
||||||
for _, eventCh := range c.events {
|
for _, eventCh := range c.events {
|
||||||
eventCh.CloseAndDiscardQueued()
|
eventCh.CloseAndDiscardQueued()
|
||||||
}
|
}
|
||||||
|
c.events = nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user