Merge pull request #13906 from chenchun/closed_chan

Fix send on closed channel bug
This commit is contained in:
Brian Goff 2015-06-12 09:37:53 -04:00
commit c98eafe564

View file

@ -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()