mirror of
https://github.com/astaxie/beego.git
synced 2025-08-31 00:57:32 +00:00
Merge pull request #4096 from jianzhiyao/request_context
fix memory leak of request context
This commit is contained in:
@@ -319,6 +319,10 @@ func (p *ControllerRegister) GetContext() *beecontext.Context {
|
||||
|
||||
// GiveBackContext put the ctx into pool so that it could be reuse
|
||||
func (p *ControllerRegister) GiveBackContext(ctx *beecontext.Context) {
|
||||
// clear input cached data
|
||||
ctx.Input.Clear()
|
||||
// clear output cached data
|
||||
ctx.Output.Clear()
|
||||
p.pool.Put(ctx)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user