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
This commit is contained in:
John Cupitt 2012-04-11 14:41:30 +01:00
parent 3540e3ef09
commit 7ef00a3d7e

View File

@ -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()) ) {