From 8ee0c30eb0950b0e142d77f4cb0da745085b2054 Mon Sep 17 00:00:00 2001 From: Jiyoun Park Date: Fri, 6 Jan 2017 15:40:09 +0900 Subject: [PATCH] evas_image_main: fix memory leak of camera app -PLM[P161206-03545] In gl engine, image objects try to unload image's pixel data after creating or updating the texture. but image entry's reference is still 1, it is added to the pending_unloads list, and it is cleaned when evas render function. If elm image use preload feature, preload_done flag is true, so this image data cannot be removed from pending_unloads list, it cause memory leak. I think it is better to free image's pixel data in evas_cache_image_unload_data, (not add to the pending_unloads list) but it it complicated to modify. so I'll remove the code to check preload_done flag in evas_common_rgba_pending_unloads_cleanup function. this flag check was added because of gl preloading, but now gl preloading feature is disabled. this flag is related with https://phab.enlightenment.org/D2823 I tested photocam, but crash doesn't occur anymore, even though removing flag check. --- src/lib/evas/common/evas_image_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/common/evas_image_main.c b/src/lib/evas/common/evas_image_main.c index ab6d06d9e3..5b7a5447d2 100644 --- a/src/lib/evas/common/evas_image_main.c +++ b/src/lib/evas/common/evas_image_main.c @@ -610,7 +610,7 @@ evas_common_rgba_pending_unloads_cleanup(void) EINA_LIST_FOREACH_SAFE(pending_unloads, l, l_next, ie) { - if ((ie->need_unload) && (!ie->preload) && (!ie->flags.preload_done)) + if ((ie->need_unload) && (!ie->preload)) { evas_common_rgba_image_unload_real(ie); pending_unloads = eina_list_remove_list(pending_unloads, l);