diff --git a/Adapter/GD.php b/Adapter/GD.php index b5172da..36ba04e 100644 --- a/Adapter/GD.php +++ b/Adapter/GD.php @@ -53,6 +53,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}