Skip to content

Commit

Permalink
SqLite: fixed fatal error when resource closed prior to result destru…
Browse files Browse the repository at this point in the history
…cting [Closes #430]
  • Loading branch information
dg committed Aug 5, 2023
1 parent 9e2a936 commit b9a1b2a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Dibi/Drivers/SqliteResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ public function __construct(\SQLite3Result $resultSet)
*/
public function __destruct()
{
if ($this->autoFree && $this->getResultResource()) {
@$this->free();
if ($this->autoFree) {
try {
$this->free();
} catch (\Error) {
}
}
}

Expand Down

0 comments on commit b9a1b2a

Please sign in to comment.