fix refleak in webpsave_buffer
And add teardown to the test-suite so we can spot refleaks more easily.
This commit is contained in:
parent
4b0c2924ab
commit
1e2ca2e0bf
|
@ -397,6 +397,8 @@ vips_foreign_save_webp_buffer_build( VipsObject *object )
|
|||
g_object_set( buffer, "buffer", blob, NULL );
|
||||
vips_area_unref( VIPS_AREA( blob ) );
|
||||
|
||||
VIPS_UNREF( streamo );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,12 @@ class TestArithmetic:
|
|||
cls.mono = cls.colour.extract_band(1)
|
||||
cls.all_images = [cls.mono, cls.colour]
|
||||
|
||||
@classmethod
|
||||
def teardown_class(cls):
|
||||
cls.colour = None
|
||||
cls.mono = None
|
||||
cls.all_images = None
|
||||
|
||||
# test all operator overloads we define
|
||||
|
||||
def test_add(self):
|
||||
|
|
|
@ -44,6 +44,13 @@ class TestConversion:
|
|||
cls.all_images = [cls.mono, cls.colour]
|
||||
cls.image = pyvips.Image.jpegload(JPEG_FILE)
|
||||
|
||||
@classmethod
|
||||
def teardown_class(cls):
|
||||
cls.colour = None
|
||||
cls.mono = None
|
||||
cls.image = None
|
||||
cls.all_images = None
|
||||
|
||||
def test_band_and(self):
|
||||
def band_and(x):
|
||||
if isinstance(x, pyvips.Image):
|
||||
|
|
|
@ -55,6 +55,17 @@ class TestConvolution:
|
|||
[-1, -2, -1]])
|
||||
cls.all_masks = [cls.sharp, cls.blur, cls.line, cls.sobel]
|
||||
|
||||
@classmethod
|
||||
def teardown_class(cls):
|
||||
cls.colour = None
|
||||
cls.mono = None
|
||||
cls.all_images = None
|
||||
cls.sharp = None
|
||||
cls.blur = None
|
||||
cls.line = None
|
||||
cls.sobel = None
|
||||
cls.all_masks = None
|
||||
|
||||
def test_conv(self):
|
||||
for im in self.all_images:
|
||||
for msk in self.all_masks:
|
||||
|
|
|
@ -38,6 +38,11 @@ class TestForeign:
|
|||
@classmethod
|
||||
def teardown_class(cls):
|
||||
shutil.rmtree(cls.tempdir, ignore_errors=True)
|
||||
cls.colour = None
|
||||
cls.mono = None
|
||||
cls.rad = None
|
||||
cls.cmyk = None
|
||||
cls.onebit = None
|
||||
|
||||
# we have test files for formats which have a clear standard
|
||||
def file_loader(self, loader, test_file, validate):
|
||||
|
|
|
@ -37,6 +37,10 @@ class TestStream:
|
|||
@classmethod
|
||||
def teardown_class(cls):
|
||||
shutil.rmtree(cls.tempdir, ignore_errors=True)
|
||||
cls.colour = None
|
||||
cls.mono = None
|
||||
cls.rad = None
|
||||
cls.cmyk = None
|
||||
|
||||
def test_streami_new_from_file(self):
|
||||
x = pyvips.Streami.new_from_file(JPEG_FILE)
|
||||
|
|
Loading…
Reference in New Issue