Browse Source

Merge pull request #13906 from chenchun/closed_chan

Fix send on closed channel bug
Brian Goff 10 years ago
parent
commit
c98eafe564
1 changed files with 1 additions and 0 deletions
  1. 1 0
      pkg/pubsub/publisher.go

+ 1 - 0
pkg/pubsub/publisher.go

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