diff --git a/pool_func.go b/pool_func.go index e062ae8..241753e 100644 --- a/pool_func.go +++ b/pool_func.go @@ -198,9 +198,8 @@ func (p *PoolWithFunc) Release() { atomic.StoreInt32(&p.release, 1) p.lock.Lock() idleWorkers := p.workers - for i, w := range idleWorkers { + for _, w := range idleWorkers { w.args <- nil - idleWorkers[i] = nil } p.workers = nil p.lock.Unlock()