diff --git a/libvips/iofuncs/buffer.c b/libvips/iofuncs/buffer.c index 5f0dc69b..c875e6e1 100644 --- a/libvips/iofuncs/buffer.c +++ b/libvips/iofuncs/buffer.c @@ -197,7 +197,7 @@ vips_buffer_done( VipsBuffer *buffer ) } } -/* Take off the public 'done' list. +/* Take off the public 'done' list. Make sure it has no calculated pixels in. */ void vips_buffer_undone( VipsBuffer *buffer ) @@ -226,14 +226,15 @@ vips_buffer_undone( VipsBuffer *buffer ) buffer->done = FALSE; buffer->cache = NULL; - buffer->area.width = 0; - buffer->area.height = 0; #ifdef DEBUG printf( "vips_buffer_undone: %d buffers left\n", g_slist_length( cache_list->buffers ) ); #endif /*DEBUG*/ } + + buffer->area.width = 0; + buffer->area.height = 0; } void diff --git a/libvips/iofuncs/region.c b/libvips/iofuncs/region.c index f590a6cb..77598091 100644 --- a/libvips/iofuncs/region.c +++ b/libvips/iofuncs/region.c @@ -782,11 +782,8 @@ vips_region_region( VipsRegion *reg, /* Init new stuff. */ - if( reg->buffer ) { + if( reg->buffer ) vips_buffer_undone( reg->buffer ); - reg->buffer->area.width = 0; - reg->buffer->area.height = 0; - } reg->invalid = FALSE; reg->valid = final; reg->bpl = dest->bpl; diff --git a/libvipsCC/VImage.cc b/libvipsCC/VImage.cc index 845e61f3..41cabd9c 100644 --- a/libvipsCC/VImage.cc +++ b/libvipsCC/VImage.cc @@ -59,7 +59,7 @@ bool init( const char *argv0 ) return( vips_init( argv0 ) == 0 ); } -void shutdown( void ) +void shutdown() { vips_shutdown(); }