diff --git a/Adapter/GD.php b/Adapter/GD.php index 21bc00c..823a3f4 100644 --- a/Adapter/GD.php +++ b/Adapter/GD.php @@ -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}