From 7ef00a3d7e99a03f37d8682f8efefc4ed48e8a3c Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 11 Apr 2012 14:41:30 +0100 Subject: [PATCH] fix a cache warning you can now call vips_cache_set_max() and friends just after vips_init() ... previously you had to wait for the cache to be built --- libvips/iofuncs/cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libvips/iofuncs/cache.c b/libvips/iofuncs/cache.c index 9a137a5d..4434ded3 100644 --- a/libvips/iofuncs/cache.c +++ b/libvips/iofuncs/cache.c @@ -542,7 +542,8 @@ vips_cache_trim( void ) { VipsOperation *operation; - while( (g_hash_table_size( vips_cache_table ) > vips_cache_max || + while( vips_cache_table && + (g_hash_table_size( vips_cache_table ) > vips_cache_max || vips_tracked_get_files() > vips_cache_max_files || vips_tracked_get_mem() > vips_cache_max_mem) && (operation = vips_cache_select()) ) {