Skip to content

Commit cc7e064

Browse files
committed
Force a reference to result set in returned iterator
1 parent 069183d commit cc7e064

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/SqlPooledResult.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ private static function dispose(\Iterator $iterator): void
8686

8787
public function getIterator(): \Traversable
8888
{
89-
return $this->iterator;
89+
// Using a Generator to keep a reference to $this.
90+
yield from $this->iterator;
9091
}
9192

9293
public function fetchRow(): ?array

0 commit comments

Comments
 (0)