From 0b711497bd24e60e931d61c05915e0972a5f5436 Mon Sep 17 00:00:00 2001 From: raster Date: Wed, 25 Apr 2012 09:31:11 +0000 Subject: [PATCH] valgrind bitches in store -> fix! git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@70462 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/elm_store.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/lib/elm_store.c b/src/lib/elm_store.c index a296f36..92303cd 100644 --- a/src/lib/elm_store.c +++ b/src/lib/elm_store.c @@ -80,7 +80,7 @@ static Elm_Genlist_Item_Class _store_item_class; static void _store_cache_trim(Elm_Store *st) { - while ((st->realized ) && + while ((st->realized) && (((int)eina_list_count(st->realized) - st->realized_count) > st->cache_max)) { @@ -122,11 +122,15 @@ _store_genlist_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, ecore_thread_cancel(st->list_th); st->list_th = NULL; } - eina_list_free(st->realized); + st->realized = eina_list_free(st->realized); while (st->items) { Elm_Store_Item *sti = (Elm_Store_Item *)st->items; - if (sti->eval_job) ecore_job_del(sti->eval_job); + if (sti->eval_job) + { + ecore_job_del(sti->eval_job); + sti->eval_job = NULL; + } if (sti->fetch_th) { ecore_thread_cancel(sti->fetch_th); @@ -547,12 +551,16 @@ elm_store_free(Elm_Store *st) ecore_thread_cancel(st->list_th); st->list_th = NULL; } - eina_list_free(st->realized); + st->realized = eina_list_free(st->realized); item_free = st->item.free; while (st->items) { Elm_Store_Item *sti = (Elm_Store_Item *)st->items; - if (sti->eval_job) ecore_job_del(sti->eval_job); + if (sti->eval_job) + { + ecore_job_del(sti->eval_job); + sti->eval_job = NULL; + } if (sti->fetch_th) { ecore_thread_cancel(sti->fetch_th); -- 2.7.4