Skip to content

Commit

Permalink
Dispose of current result when next result is requested
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Sep 1, 2023
1 parent 8a7d4ac commit a267853
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Internal/MysqlConnectionResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ public function fetchRow(): ?array

public function getNextResult(): ?MysqlResult
{
if ($this->generator->valid()) {
throw new \Error('Consume entire current result before requesting next result');
}
self::dispose($this->generator);

$this->nextResult ??= async(function (): ?MysqlResult {
$deferred = $this->result->next ??= new DeferredFuture;
Expand Down

0 comments on commit a267853

Please sign in to comment.