check for blocked operations on cache lookup

We could return an operation from cache even after the operatuion had
been blocked. This was harmless, but could cause confusion.

see https://github.com/kleisauke/wasm-vips/pull/24
This commit is contained in:
John Cupitt 2022-09-04 16:35:00 +01:00
parent 078ac059b7
commit 702ed8298f
1 changed files with 4 additions and 2 deletions

View File

@ -798,8 +798,10 @@ vips_cache_operation_lookup( VipsOperation *operation )
result = NULL;
if( (hit = g_hash_table_lookup( vips_cache_table, operation )) ) {
if( hit->invalid ) {
/* There but has been tagged for removal.
if( hit->invalid ||
(VIPS_OPERATION_GET_CLASS( hit->operation )->flags &
VIPS_OPERATION_BLOCKED) ) {
/* Has been tagged for removal, or has been blocked.
*/
vips_cache_remove( hit->operation );
hit = NULL;