diff --git a/src/Config.php b/src/Config.php index 5a9294fc..91c19ce2 100644 --- a/src/Config.php +++ b/src/Config.php @@ -781,6 +781,9 @@ private static function init(): void self::$gobject = \FFI::cdef($gobject_decls, $gobject_libname); self::$vips = \FFI::cdef($vips_decls, $vips_libname); + # Useful for debugging + # self::$vips->vips_leak_set(1); + # force the creation of some types we need self::$vips->vips_blend_mode_get_type(); self::$vips->vips_interpretation_get_type(); diff --git a/tests/ConvenienceTest.php b/tests/ConvenienceTest.php index 34fa4f92..48c7bf74 100644 --- a/tests/ConvenienceTest.php +++ b/tests/ConvenienceTest.php @@ -24,6 +24,12 @@ protected function setUp(): void $this->pixel = $this->image->getpoint(0, 0); } + protected function tearDown(): void + { + unset($this->image); + unset($this->pixel); + } + public function testVipsBandjoin() { $image = Vips\Image::newFromArray([[1, 2, 3], [4, 5, 6]]); diff --git a/tests/ExceptionTest.php b/tests/ExceptionTest.php index 262e519d..343b5212 100644 --- a/tests/ExceptionTest.php +++ b/tests/ExceptionTest.php @@ -12,16 +12,15 @@ class ExceptionTest extends TestCase */ private $image; - /** - * The original value of pixel (0, 0). - */ - private $pixel; - protected function setUp(): void { $filename = __DIR__ . '/images/img_0076.jpg'; $this->image = Vips\Image::newFromFile($filename); - $this->pixel = $this->image->getpoint(0, 0); + } + + protected function tearDown(): void + { + unset($this->image); } public function testVipsNewFromFileException() diff --git a/tests/MetaTest.php b/tests/MetaTest.php index 9447fe3c..8b8bb066 100644 --- a/tests/MetaTest.php +++ b/tests/MetaTest.php @@ -26,6 +26,12 @@ protected function setUp(): void $this->png_image = Vips\Image::newFromFile($png_filename); } + protected function tearDown(): void + { + unset($this->image); + unset($this->png_image); + } + public function testVipsSetGet() { $this->image->poop = 'banana'; diff --git a/tests/ShortcutTest.php b/tests/ShortcutTest.php index a4cc80c2..4be1a46c 100644 --- a/tests/ShortcutTest.php +++ b/tests/ShortcutTest.php @@ -37,6 +37,12 @@ protected function setUp(): void $this->pixel = $this->image->getpoint(0, 0); } + protected function tearDown(): void + { + unset($this->image); + unset($this->pixel); + } + public function testVipsPow() { $real = self::mapNumeric($this->pixel, function ($value) {