Merge pull request #13906 from chenchun/closed_chan
Fix send on closed channel bug
This commit is contained in:
commit
c98eafe564
1 changed files with 1 additions and 0 deletions
|
@ -68,6 +68,7 @@ func (p *Publisher) Publish(v interface{}) {
|
|||
func (p *Publisher) Close() {
|
||||
p.m.Lock()
|
||||
for sub := range p.subscribers {
|
||||
delete(p.subscribers, sub)
|
||||
close(sub)
|
||||
}
|
||||
p.m.Unlock()
|
||||
|
|
Loading…
Add table
Reference in a new issue