diff --git a/pool.go b/pool.go index 72fc7e2..003b11d 100644 --- a/pool.go +++ b/pool.go @@ -106,6 +106,9 @@ func (p *Pool) Release() error { for i := 0; i < running; i++ { p.getWorker().stop() } + for i := range p.workers{ + p.workers[i] = nil + } }) return nil } diff --git a/pool_func.go b/pool_func.go index 74d1eb4..8739feb 100644 --- a/pool_func.go +++ b/pool_func.go @@ -111,6 +111,9 @@ func (p *PoolWithFunc) Release() error { for i := 0; i < running; i++ { p.getWorker().stop() } + for i := range p.workers{ + p.workers[i] = nil + } }) return nil }