diff --git a/src/Pool/AbstractPool.php b/src/Pool/AbstractPool.php index 6bb28fc..c72a042 100644 --- a/src/Pool/AbstractPool.php +++ b/src/Pool/AbstractPool.php @@ -177,11 +177,11 @@ public static function invoke(callable $call,float $timeout = null) if($obj){ try{ $ret = call_user_func($call,$obj); - $pool->recycleObj($obj); return $ret; }catch (\Throwable $throwable){ - $pool->recycleObj($obj); throw $throwable; + }finally{ + $pool->recycleObj($obj); } }else{ throw new PoolEmpty(static::class." pool is empty");