free shrinkv resources earlier
Free the shrinkv line buffer and struct at the end of eval, not on image dispose. This helps keep mem use down in some long-running operations. Thank you homm, see https://github.com/libvips/pyvips/issues/147
This commit is contained in:
parent
be3775e868
commit
3b2c77dd35
@ -124,6 +124,8 @@ vips_shrinkv_stop( void *vseq, void *a, void *b )
|
|||||||
VipsShrinkvSequence *seq = (VipsShrinkvSequence *) vseq;
|
VipsShrinkvSequence *seq = (VipsShrinkvSequence *) vseq;
|
||||||
|
|
||||||
VIPS_FREEF( g_object_unref, seq->ir );
|
VIPS_FREEF( g_object_unref, seq->ir );
|
||||||
|
VIPS_FREE( seq->sum );
|
||||||
|
VIPS_FREE( seq );
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
@ -137,14 +139,14 @@ vips_shrinkv_start( VipsImage *out, void *a, void *b )
|
|||||||
VipsShrinkv *shrink = (VipsShrinkv *) b;
|
VipsShrinkv *shrink = (VipsShrinkv *) b;
|
||||||
VipsShrinkvSequence *seq;
|
VipsShrinkvSequence *seq;
|
||||||
|
|
||||||
if( !(seq = VIPS_NEW( out, VipsShrinkvSequence )) )
|
if( !(seq = VIPS_NEW( NULL, VipsShrinkvSequence )) )
|
||||||
return( NULL );
|
return( NULL );
|
||||||
|
|
||||||
seq->ir = vips_region_new( in );
|
seq->ir = vips_region_new( in );
|
||||||
|
|
||||||
/* Big enough for the largest intermediate .. a whole scanline.
|
/* Big enough for the largest intermediate .. a whole scanline.
|
||||||
*/
|
*/
|
||||||
seq->sum = VIPS_ARRAY( out, shrink->sizeof_line_buffer, VipsPel );
|
seq->sum = VIPS_ARRAY( NULL, shrink->sizeof_line_buffer, VipsPel );
|
||||||
|
|
||||||
return( (void *) seq );
|
return( (void *) seq );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user