summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-01-31 14:47:36 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-01-31 23:01:50 +0900
commite2fe31fc09fa4622a7c1e2591db15a98cec6aca0 (patch)
treea06b43ade0cbd2e046a7b5577b567d27103129b8
parent3f92bfc45bae5f74b18ac98b989da4e7a14c1fd1 (diff)
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
-rw-r--r--src/lib/evas/cache/evas_cache_image.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/evas/cache/evas_cache_image.c b/src/lib/evas/cache/evas_cache_image.c
index 3c46d4a81a..14940d93a8 100644
--- a/src/lib/evas/cache/evas_cache_image.c
+++ b/src/lib/evas/cache/evas_cache_image.c
@@ -462,13 +462,6 @@ _evas_cache_image_async_cancel(void *data)
462 _evas_cache_image_entry_delete(ie->cache, ie); 462 _evas_cache_image_entry_delete(ie->cache, ie);
463 return; 463 return;
464 } 464 }
465 if (ie->flags.loaded) _evas_cache_image_async_end(ie);
466 if (ie->references == 0)
467 {
468 _evas_cache_image_lru_add(ie);
469 cache = ie->cache;
470 }
471 if (cache) evas_cache_image_flush(cache);
472 SLKL(ie->lock_task); 465 SLKL(ie->lock_task);
473 if (ie->targets) 466 if (ie->targets)
474 { 467 {
@@ -483,6 +476,13 @@ _evas_cache_image_async_cancel(void *data)
483 ie); 476 ie);
484 } 477 }
485 SLKU(ie->lock_task); 478 SLKU(ie->lock_task);
479 if (ie->references == 0)
480 {
481 _evas_cache_image_lru_add(ie);
482 cache = ie->cache;
483 }
484 if (ie->flags.loaded) _evas_cache_image_async_end(ie);
485 if (cache) evas_cache_image_flush(cache);
486} 486}
487 487
488// note - preload_add assumes a target is ONLY added ONCE to the image 488// note - preload_add assumes a target is ONLY added ONCE to the image