Skip to content

Commit

Permalink
Free the image resource when the owner is deallocated
Browse files Browse the repository at this point in the history
  • Loading branch information
tsnorri committed May 31, 2018
1 parent c506d57 commit c7dba4a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Adapter/GD.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ public function __construct()
throw new \RuntimeException('You need to install GD PHP Extension to use this library');
}
}

public function __destruct()
{
if (null !== $this->resource)
imagedestroy($this->resource);
}

/**
* {@inheritdoc}
Expand Down

0 comments on commit c7dba4a

Please sign in to comment.