public function destroy() { if ($this->resource) { imagedestroy($this->resource); } parent::destroy(); }