forked from enlightenment/efl
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:
parent
618bce8038
commit
54217cda84
|
@ -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));
|
entry = eina_list_data_get(eina_list_last(cache->lru_list));
|
||||||
// if its still being ref.
|
// if its still being ref.
|
||||||
if (entry->ref) return;
|
if (entry->ref > 1) return;
|
||||||
eina_hash_del(cache->hash, &entry->key, entry);
|
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->lru_list = eina_list_remove_list(cache->lru_list, eina_list_last(cache->lru_list));
|
||||||
cache->free_func(cache->user_data, entry->data);
|
cache->free_func(cache->user_data, entry->data);
|
||||||
|
|
Loading…
Reference in New Issue