diff --git a/src/Captcha.php b/src/Captcha.php index f57286e..f0926d4 100644 --- a/src/Captcha.php +++ b/src/Captcha.php @@ -227,7 +227,6 @@ protected function applyWave($width, $height) } } - imagedestroy($this->image); $this->image = $img2; } @@ -237,7 +236,6 @@ public function output(): void header('Cache-Control: no-cache, no-store, must-revalidate'); header('Content-Type: image/png'); imagepng($this->image); - imagedestroy($this->image); } public function getBase64(): string @@ -246,7 +244,6 @@ public function getBase64(): string ob_start(); imagepng($this->image); $data = ob_get_clean(); - imagedestroy($this->image); return 'data:image/png;base64,' . base64_encode($data); } @@ -254,7 +251,6 @@ public function save(string $path): bool { if (!isset($this->image)) throw new Exception("Image not created."); $result = imagepng($this->image, $path); - imagedestroy($this->image); return $result; } -} +} \ No newline at end of file