Remove reference to conn from buffered reader and writer when releasing RequestCtx. This should help GC a bit :)

This commit is contained in:
Aliaksandr Valialkin
2015-11-02 19:11:09 +02:00
parent fb362174d7
commit 1429b48135
+6
View File
@@ -567,6 +567,12 @@ func (s *Server) releaseCtx(ctx *RequestCtx) {
panic("BUG: cannot release RequestCtx with shadow")
}
ctx.c = nil
if ctx.r != nil {
ctx.r.Reset(nil)
}
if ctx.w != nil {
ctx.w.Reset(nil)
}
s.ctxPool.Put(ctx.v)
}