evas image cache: drop cache properly,

the default reference is 1,
thus we should drop it unless if it's more than 1,
This commit is contained in:
Hermet Park 2019-11-18 11:49:52 +09:00
parent 618bce8038
commit 54217cda84
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ generic_cache_data_set(Generic_Cache *cache, void *key, void *surface)
{
entry = eina_list_data_get(eina_list_last(cache->lru_list));
// if its still being ref.
if (entry->ref) return;
if (entry->ref > 1) return;
eina_hash_del(cache->hash, &entry->key, entry);
cache->lru_list = eina_list_remove_list(cache->lru_list, eina_list_last(cache->lru_list));
cache->free_func(cache->user_data, entry->data);