Skip to content

Commit

Permalink
Merge pull request #3 from Kubuxu/race
Browse files Browse the repository at this point in the history
Prevent race of contidion from panic
  • Loading branch information
whyrusleeping committed Jun 9, 2016
2 parents 7014ba2 + 0b8a784 commit cceaba9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gx/lastpubver
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0: QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8
1.1.1: QmYtB7Qge8cJpXc4irsEp8zRqfnZMBeB7aTrMEkPk67DRv
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
"language": "go",
"license": "",
"name": "go-log",
"version": "1.1.0"
}
"version": "1.1.1"
}
4 changes: 3 additions & 1 deletion writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ func (bw *bufWriter) loop() {
if bufsize > MaxWriterBuffer {
// if we have too many messages buffered, kill the writer
bw.die()
close(nextCh)
if nextCh != nil {
close(nextCh)
}
nextCh = nil
// explicity keep going here to drain incoming
}
Expand Down

0 comments on commit cceaba9

Please sign in to comment.