Browse Source

Reset gzip encoder on put to pool

DarthSim 6 years ago
parent
commit
6007f1a99b
1 changed files with 2 additions and 0 deletions
  1. 2 0
      gzippool.go

+ 2 - 0
gzippool.go

@@ -59,5 +59,7 @@ func (p *gzipPool) Put(gz *gzip.Writer) {
 	p.mutex.Lock()
 	defer p.mutex.Unlock()
 
+	gz.Reset(ioutil.Discard)
+
 	p.top = &gzipPoolEntry{gz: gz, next: p.top}
 }