Skip to content

Commit

Permalink
Fix data race panic
Browse files Browse the repository at this point in the history
  • Loading branch information
beatgammit committed Oct 31, 2016
1 parent 20397bd commit 4a4b738
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ func (c *Client) registerListener(id ID) {
}

func (c *Client) unregisterListener(id ID) {
c.lock.Lock()
defer c.lock.Unlock()

log.Println("unregister listener:", id)
delete(c.listeners, id)
}
Expand Down

0 comments on commit 4a4b738

Please sign in to comment.