Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
bg5sbk committed Feb 5, 2015
1 parent 745d28b commit 795cd4f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,13 @@ func (out *OutBuffer) reset() {

// Return the buffer to buffer pool.
func (out *OutBuffer) free() {
if out.isFreed {
panic("link.OutBuffer: double free")
if enableBufferPool {
if out.isFreed {
panic("link.OutBuffer: double free")
}
out.reset()
out.pool.PutOutBuffer(out)
}
out.reset()
out.pool.PutOutBuffer(out)
}

// Prepare for next message.
Expand Down

0 comments on commit 795cd4f

Please sign in to comment.