diff --git a/lib/AbstractPool.php b/lib/AbstractPool.php index e06fff9..c363545 100644 --- a/lib/AbstractPool.php +++ b/lib/AbstractPool.php @@ -153,6 +153,10 @@ private function pop(): \Generator { * @throws \Error If the connection is not part of this pool. */ private function push(Connection $connection) { + if ($this->closed) { + return; + } + \assert(isset($this->connections[$connection]), 'Connection is not part of this pool'); if ($connection->isAlive()) {