evas async preload - fix valgrind issue in accessing image after free

cache flish and async end ended up dropping some cacneled images that
were then accessed further in the cancel func for the thread. this
fixes that

@fix
This commit is contained in:
Carsten Haitzler 2017-01-31 14:47:36 +09:00
parent 3f92bfc45b
commit e2fe31fc09
1 changed files with 7 additions and 7 deletions

View File

@ -462,13 +462,6 @@ _evas_cache_image_async_cancel(void *data)
_evas_cache_image_entry_delete(ie->cache, ie);
return;
}
if (ie->flags.loaded) _evas_cache_image_async_end(ie);
if (ie->references == 0)
{
_evas_cache_image_lru_add(ie);
cache = ie->cache;
}
if (cache) evas_cache_image_flush(cache);
SLKL(ie->lock_task);
if (ie->targets)
{
@ -483,6 +476,13 @@ _evas_cache_image_async_cancel(void *data)
ie);
}
SLKU(ie->lock_task);
if (ie->references == 0)
{
_evas_cache_image_lru_add(ie);
cache = ie->cache;
}
if (ie->flags.loaded) _evas_cache_image_async_end(ie);
if (cache) evas_cache_image_flush(cache);
}
// note - preload_add assumes a target is ONLY added ONCE to the image