Skip to content

Commit d3df9c0

Browse files
author
imota
committed
And so the leak was then passing the adapter as a constructor argument to the NativePDOIterator, which in place turned not necessary after all.
1 parent b429825 commit d3df9c0

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function create(\PDO $adapter, $query, $blockSize)
1616
$adapter->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_ASSOC);
1717
$adapter->setAttribute(
1818
\PDO::ATTR_STATEMENT_CLASS,
19-
[NativePDOIterator::class, [$adapter]]
19+
[NativePDOIterator::class, []]
2020
);
2121
/** @var Iterator $statement */
2222
$statement = $adapter->query($query);

src/NativePDOIterator.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44

55
class NativePDOIterator extends \PDOStatement implements Iterator
66
{
7-
protected $pdo;
8-
9-
protected function __construct($pdo) {
10-
$this->pdo = $pdo;
7+
protected function __construct()
8+
{
119
}
1210

1311
public function count()
@@ -18,6 +16,5 @@ public function count()
1816
public function close()
1917
{
2018
parent::closeCursor();
21-
$this->pdo = null;
2219
}
2320
}

0 commit comments

Comments
 (0)