function GDToolkit::__destruct

Same name in other branches
  1. 8.9.x 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 106

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);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.