You are here

public function GDToolkit::__destruct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php \Drupal\system\Plugin\ImageToolkit\GDToolkit::__destruct()

Destructs a GDToolkit object.

Frees memory associated with a GD image resource.

@todo Remove the method for PHP 8.0+ https://www.drupal.org/node/3173031

File

core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php, line 104

Class

GDToolkit
Defines the GD2 toolkit for image manipulation within Drupal.

Namespace

Drupal\system\Plugin\ImageToolkit

Code

public function __destruct() {
  if (is_resource($this->resource)) {
    imagedestroy($this->resource);
  }
}