diff --git a/src/Classes/SimpleImage.php b/src/Classes/SimpleImage.php index e51a660..3206558 100644 --- a/src/Classes/SimpleImage.php +++ b/src/Classes/SimpleImage.php @@ -38,7 +38,7 @@ public function __construct($image = null) { // Destroys the image resource // public function __destruct() { - if($this->image !== null && get_resource_type($this->image) === 'gd') { + if(is_object($this->image) && $this->image instanceof \GDImage) { imagedestroy($this->image); } } @@ -1797,4 +1797,4 @@ public static function normalizeColor($color) { throw new \Exception("Invalid color value: $color", self::ERR_INVALID_COLOR); } -} \ No newline at end of file +}