summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjinwoo.shin <jw0227.shin@samsung.com>2016-07-29 11:08:09 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-07-29 11:08:09 +0900
commitc7c387b33a4f242c981ca41aacbdc6004b7ce344 (patch)
treeda3ede91e622c791c2ff17e78a6da73de1d314b0
parent29fce429004f9f14d79c5bfa97b1010c2113fa15 (diff)
Fix memory leak issue on genlist_example_02
Summary: The realized items list should be freed by either eina_list_free() or EINA_LIST_FREE when it is no longer needed Reviewers: cedric, jpeg Reviewed By: jpeg Subscribers: minkyu Differential Revision: https://phab.enlightenment.org/D4193
-rw-r--r--src/examples/elementary/genlist_example_02.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/examples/elementary/genlist_example_02.c b/src/examples/elementary/genlist_example_02.c
index 6779677..28e1269 100644
--- a/src/examples/elementary/genlist_example_02.c
+++ b/src/examples/elementary/genlist_example_02.c
@@ -52,7 +52,8 @@ _show_status_cb(void *data, Evas_Object *o, void *event_info)
52 Evas_Coord x, y, w, h, mx, my; 52 Evas_Coord x, y, w, h, mx, my;
53 Elm_Object_Item *glit = elm_genlist_selected_item_get(list); 53 Elm_Object_Item *glit = elm_genlist_selected_item_get(list);
54 54
55 const Eina_List *selected, *l, *realized; 55 const Eina_List *selected, *l;
56 Eina_List *realized;
56 printf("\nfirst selected item: %p\n", glit); 57 printf("\nfirst selected item: %p\n", glit);
57 58
58 selected = elm_genlist_selected_items_get(list); 59 selected = elm_genlist_selected_items_get(list);
@@ -63,7 +64,8 @@ _show_status_cb(void *data, Evas_Object *o, void *event_info)
63 64
64 realized = elm_genlist_realized_items_get(list); 65 realized = elm_genlist_realized_items_get(list);
65 printf("realized items (%d): ", eina_list_count(realized)); 66 printf("realized items (%d): ", eina_list_count(realized));
66 EINA_LIST_FOREACH(realized, l, glit) 67 // The realized items list should be freed by either eina_list_free() or EINA_LIST_FREE when it is no longer needed
68 EINA_LIST_FREE(realized, glit)
67 printf("%p ", glit); 69 printf("%p ", glit);
68 printf("\n"); 70 printf("\n");
69 printf("genlist mode: %d\n", elm_genlist_decorate_mode_get(list)); 71 printf("genlist mode: %d\n", elm_genlist_decorate_mode_get(list));