From a1b3820eb2668212629458d6df33d4a27304aeb7 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Sun, 27 Apr 2014 20:31:43 +0100 Subject: [PATCH] Make cache limits 'hard' rather than 'soft' using trim after add, not before --- libvips/iofuncs/cache.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libvips/iofuncs/cache.c b/libvips/iofuncs/cache.c index 40cdbcdc..3db8697c 100644 --- a/libvips/iofuncs/cache.c +++ b/libvips/iofuncs/cache.c @@ -688,8 +688,6 @@ vips_cache_operation_buildp( VipsOperation **operation ) vips_object_print_dump( VIPS_OBJECT( *operation ) ); #endif /*VIPS_DEBUG*/ - vips_cache_trim(); - g_mutex_lock( vips_cache_lock ); if( (hit = g_hash_table_lookup( vips_cache_table, *operation )) ) { @@ -735,6 +733,7 @@ vips_cache_operation_buildp( VipsOperation **operation ) g_mutex_unlock( vips_cache_lock ); } + vips_cache_trim(); return( 0 ); }