Skip to content

Commit cceaba9

Browse files
Merge pull request #3 from Kubuxu/race
Prevent race of contidion from panic
2 parents 7014ba2 + 0b8a784 commit cceaba9

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.gx/lastpubver

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.0: QmaDNZ4QMdBdku1YZWBysufYyoQt1negQGNav6PLYarbY8
1+
1.1.1: QmYtB7Qge8cJpXc4irsEp8zRqfnZMBeB7aTrMEkPk67DRv

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
"language": "go",
2424
"license": "",
2525
"name": "go-log",
26-
"version": "1.1.0"
27-
}
26+
"version": "1.1.1"
27+
}

writer.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,9 @@ func (bw *bufWriter) loop() {
230230
if bufsize > MaxWriterBuffer {
231231
// if we have too many messages buffered, kill the writer
232232
bw.die()
233-
close(nextCh)
233+
if nextCh != nil {
234+
close(nextCh)
235+
}
234236
nextCh = nil
235237
// explicity keep going here to drain incoming
236238
}

0 commit comments

Comments
 (0)