diff --git a/pool.go b/pool.go index bde807e..3c3b9d7 100644 --- a/pool.go +++ b/pool.go @@ -144,12 +144,14 @@ type Res struct { func (r *Res) Release() error { r.cancel() + err := r.c.Wait() + r.p.rw.Lock() defer r.p.rw.Unlock() delete(r.p.res, r.port) - return nil + return err } // Port returns the allocated port for the pool resource.