From d77f01cf9a0bdbafc616f5ebbf92ed3db023e634 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Sun, 15 Jul 2018 00:57:32 +0800 Subject: [PATCH] optimization for GC --- pool.go | 1 + pool_func.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pool.go b/pool.go index e7836e5..53471e2 100644 --- a/pool.go +++ b/pool.go @@ -148,6 +148,7 @@ func (p *Pool) Release() error { for i := range p.workers { p.workers[i] = nil } + p.workers = nil }) return nil } diff --git a/pool_func.go b/pool_func.go index 407651a..d99269f 100644 --- a/pool_func.go +++ b/pool_func.go @@ -153,6 +153,7 @@ func (p *PoolWithFunc) Release() error { for i := range p.workers { p.workers[i] = nil } + p.workers = nil }) return nil }