Skip to content

Commit 1e1155d

Browse files
committed
Remove circular reference in destructor
1 parent d5f70b2 commit 1e1155d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/PqUnbufferedResultSet.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ public function __destruct()
5252
return;
5353
}
5454

55-
asyncCall(function () {
55+
$producer = $this->producer;
56+
asyncCall(static function () use ($producer) {
5657
try {
57-
while (yield $this->producer->advance());
58+
while (yield $producer->advance());
5859
} catch (\Throwable $exception) {
5960
// Ignore iterator failure when destroying.
6061
}

0 commit comments

Comments
 (0)