summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTae-Hwan Kim <the81.kim@samsung.com>2013-03-13 20:54:19 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2013-03-13 20:54:29 +0900
commit7e97bbb945c6fe91782318f874d224772ae44657 (patch)
tree712a07c46b5d3363c611e6e4377c7c167664c977
parente43b43f59f45841968c6295f01c14e0d7151407c (diff)
genlist: Fix memory leaks.
Return value of elm_genlist_realized_items_get should be freed
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/lib/elm_genlist.c26
3 files changed, 18 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 38bbf8b57..11258262c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -774,3 +774,7 @@
7742013-03-13 WooHyun Jung 7742013-03-13 WooHyun Jung
775 775
776 * List : Focus_next should be executed only when access mode is enabled. 776 * List : Focus_next should be executed only when access mode is enabled.
777
7782013-03-13 Tae-Hwan Kim (bluezery)
779
780 * Fix a memory leak in elm_genlist. Return value of elm_genlist_realized_items_get should be freed
diff --git a/NEWS b/NEWS
index c8649096b..4e24fb864 100644
--- a/NEWS
+++ b/NEWS
@@ -136,6 +136,7 @@ Fixes:
136 * Fixed gengrid wrong_calc_job parameter. 136 * Fixed gengrid wrong_calc_job parameter.
137 * Fix elm_transit image animation that last few frames are skipped. 137 * Fix elm_transit image animation that last few frames are skipped.
138 * FIx elm_transit to accept proxy object. 138 * FIx elm_transit to accept proxy object.
139 * Fix a memory leak of elm_genlist - EINA_LIST_FREE should be used for returned value of elm_genlist_realized_items_get
139 140
140Changes since Elementary 1.0.0: 141Changes since Elementary 1.0.0:
141------------------------- 142-------------------------
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 13845818a..7da8cc451 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -2957,7 +2957,7 @@ _long_press_cb(void *data)
2957{ 2957{
2958 Elm_Gen_Item *it = data, *it_tmp; 2958 Elm_Gen_Item *it = data, *it_tmp;
2959 Elm_Genlist_Smart_Data *sd; 2959 Elm_Genlist_Smart_Data *sd;
2960 Eina_List *list, *l; 2960 Eina_List *list;
2961 2961
2962 sd = GL_IT(it)->wsd; 2962 sd = GL_IT(it)->wsd;
2963 2963
@@ -2983,10 +2983,9 @@ _long_press_cb(void *data)
2983 2983
2984 list = elm_genlist_realized_items_get 2984 list = elm_genlist_realized_items_get
2985 (ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj); 2985 (ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj);
2986 EINA_LIST_FOREACH (list, l, it_tmp) 2986 EINA_LIST_FREE(list, it_tmp)
2987 { 2987 if (it != it_tmp) _item_unselect(it_tmp);
2988 if (it != it_tmp) _item_unselect(it_tmp); 2988
2989 }
2990 if (elm_genlist_item_expanded_get((Elm_Object_Item *)it)) 2989 if (elm_genlist_item_expanded_get((Elm_Object_Item *)it))
2991 { 2990 {
2992 elm_genlist_item_expanded_set((Elm_Object_Item *)it, EINA_FALSE); 2991 elm_genlist_item_expanded_set((Elm_Object_Item *)it, EINA_FALSE);
@@ -4628,14 +4627,14 @@ _access_obj_process(Elm_Genlist_Smart_Data * sd, Eina_Bool is_access)
4628{ 4627{
4629 Item_Block *itb; 4628 Item_Block *itb;
4630 Eina_Bool done = EINA_FALSE; 4629 Eina_Bool done = EINA_FALSE;
4631 4630
4632 EINA_INLIST_FOREACH(sd->blocks, itb) 4631 EINA_INLIST_FOREACH(sd->blocks, itb)
4633 { 4632 {
4634 if (itb->realized) 4633 if (itb->realized)
4635 { 4634 {
4636 Eina_List *l; 4635 Eina_List *l;
4637 Elm_Gen_Item *it; 4636 Elm_Gen_Item *it;
4638 4637
4639 done = EINA_TRUE; 4638 done = EINA_TRUE;
4640 EINA_LIST_FOREACH(itb->items, l, it) 4639 EINA_LIST_FOREACH(itb->items, l, it)
4641 { 4640 {
@@ -4654,7 +4653,7 @@ _access_hook(Evas_Object *obj, Eina_Bool is_access)
4654{ 4653{
4655 ELM_GENLIST_CHECK(obj); 4654 ELM_GENLIST_CHECK(obj);
4656 ELM_GENLIST_DATA_GET(obj, sd); 4655 ELM_GENLIST_DATA_GET(obj, sd);
4657 4656
4658 if (is_access) 4657 if (is_access)
4659 ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next = 4658 ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next =
4660 _elm_genlist_smart_focus_next; 4659 _elm_genlist_smart_focus_next;
@@ -6351,13 +6350,13 @@ elm_genlist_scroller_policy_get(const Evas_Object *obj,
6351EAPI void 6350EAPI void
6352elm_genlist_realized_items_update(Evas_Object *obj) 6351elm_genlist_realized_items_update(Evas_Object *obj)
6353{ 6352{
6354 Eina_List *list, *l; 6353 Eina_List *list;
6355 Elm_Object_Item *it; 6354 Elm_Object_Item *it;
6356 6355
6357 ELM_GENLIST_CHECK(obj); 6356 ELM_GENLIST_CHECK(obj);
6358 6357
6359 list = elm_genlist_realized_items_get(obj); 6358 list = elm_genlist_realized_items_get(obj);
6360 EINA_LIST_FOREACH (list, l, it) 6359 EINA_LIST_FREE(list, it)
6361 elm_genlist_item_update(it); 6360 elm_genlist_item_update(it);
6362} 6361}
6363 6362
@@ -6440,7 +6439,7 @@ elm_genlist_decorate_mode_set(Evas_Object *obj,
6440 Eina_Bool decorated) 6439 Eina_Bool decorated)
6441{ 6440{
6442 Elm_Gen_Item *it; 6441 Elm_Gen_Item *it;
6443 Eina_List *list, *l; 6442 Eina_List *list;
6444 Elm_Object_Item *deco_it; 6443 Elm_Object_Item *deco_it;
6445 6444
6446 ELM_GENLIST_CHECK(obj); 6445 ELM_GENLIST_CHECK(obj);
@@ -6460,7 +6459,7 @@ elm_genlist_decorate_mode_set(Evas_Object *obj,
6460 list = elm_genlist_realized_items_get(obj); 6459 list = elm_genlist_realized_items_get(obj);
6461 if (!sd->decorate_all_mode) 6460 if (!sd->decorate_all_mode)
6462 { 6461 {
6463 EINA_LIST_FOREACH (list, l, it) 6462 EINA_LIST_FREE(list, it)
6464 { 6463 {
6465 if (it->item->type != ELM_GENLIST_ITEM_GROUP) 6464 if (it->item->type != ELM_GENLIST_ITEM_GROUP)
6466 _decorate_all_item_unrealize(it); 6465 _decorate_all_item_unrealize(it);
@@ -6479,7 +6478,7 @@ elm_genlist_decorate_mode_set(Evas_Object *obj,
6479 _decorate_item_finished_signal_cb(deco_it, obj, NULL, NULL); 6478 _decorate_item_finished_signal_cb(deco_it, obj, NULL, NULL);
6480 } 6479 }
6481 6480
6482 EINA_LIST_FOREACH (list, l, it) 6481 EINA_LIST_FREE(list, it)
6483 { 6482 {
6484 if (it->item->type != ELM_GENLIST_ITEM_GROUP) 6483 if (it->item->type != ELM_GENLIST_ITEM_GROUP)
6485 { 6484 {
@@ -6488,6 +6487,7 @@ elm_genlist_decorate_mode_set(Evas_Object *obj,
6488 } 6487 }
6489 } 6488 }
6490 } 6489 }
6490
6491 if (sd->calc_job) ecore_job_del(sd->calc_job); 6491 if (sd->calc_job) ecore_job_del(sd->calc_job);
6492 sd->calc_job = ecore_job_add(_calc_job, sd); 6492 sd->calc_job = ecore_job_add(_calc_job, sd);
6493} 6493}