summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2014-05-29 16:03:59 +0300
committerYakov Goldberg <yakov.g@samsung.com>2014-05-29 16:03:59 +0300
commit046e3e204015ab585f7bf7b186847924dff2edaf (patch)
tree237c1095b2970d429048ce80de96c62ace07d760
parent169c31a42ad3699db86eb73eb883b09edc9f4995 (diff)
leak fixes
-rw-r--r--src/bin/egui_gui/editor.c1
-rw-r--r--src/bin/egui_gui/itemview.c10
-rw-r--r--src/bin/egui_gui/itemview.h3
-rw-r--r--src/bin/egui_gui/objtree.c3
-rw-r--r--src/lib/database.c1
-rw-r--r--src/lib/gui_widget.c20
6 files changed, 33 insertions, 5 deletions
diff --git a/src/bin/egui_gui/editor.c b/src/bin/egui_gui/editor.c
index d0351ed..2166cd6 100644
--- a/src/bin/egui_gui/editor.c
+++ b/src/bin/egui_gui/editor.c
@@ -1265,6 +1265,7 @@ _editor_shutdown()
1265 target_db_shutdown(); 1265 target_db_shutdown();
1266 seqview_shutdown(); 1266 seqview_shutdown();
1267 propview_shutdown(); 1267 propview_shutdown();
1268 itemview_shutdown();
1268 objtree_list_unset(); 1269 objtree_list_unset();
1269 1270
1270 void *p = (void *) propview_cbs_get(); 1271 void *p = (void *) propview_cbs_get();
diff --git a/src/bin/egui_gui/itemview.c b/src/bin/egui_gui/itemview.c
index 5ceb93e..37588d4 100644
--- a/src/bin/egui_gui/itemview.c
+++ b/src/bin/egui_gui/itemview.c
@@ -199,6 +199,16 @@ itemview_init(Eo *list)
199} 199}
200 200
201void 201void
202itemview_shutdown()
203{
204 if (_item_itc)
205 {
206 elm_genlist_item_class_free(_item_itc);
207 _item_itc = NULL;
208 }
209}
210
211void
202itemview_build(const Gui_Widget *wdg) 212itemview_build(const Gui_Widget *wdg)
203{ 213{
204 Eina_List *itr; 214 Eina_List *itr;
diff --git a/src/bin/egui_gui/itemview.h b/src/bin/egui_gui/itemview.h
index d1a191f..423c384 100644
--- a/src/bin/egui_gui/itemview.h
+++ b/src/bin/egui_gui/itemview.h
@@ -14,6 +14,9 @@ void
14itemview_init(Eo *list); 14itemview_init(Eo *list);
15 15
16void 16void
17itemview_shutdown();
18
19void
17itemview_build(const Gui_Widget *wdg); 20itemview_build(const Gui_Widget *wdg);
18 21
19Gui_Widget_Item* 22Gui_Widget_Item*
diff --git a/src/bin/egui_gui/objtree.c b/src/bin/egui_gui/objtree.c
index cb7a599..46af0cc 100644
--- a/src/bin/egui_gui/objtree.c
+++ b/src/bin/egui_gui/objtree.c
@@ -13,7 +13,7 @@ static ObjTreeViewCbs *_view_cbs = NULL;
13static Elm_Genlist_Item_Class *_itc = NULL; 13static Elm_Genlist_Item_Class *_itc = NULL;
14 14
15/* Hash table from widgets to genlist items */ 15/* Hash table from widgets to genlist items */
16Eina_Hash *_widgets_to_items_hash_table = NULL; 16static Eina_Hash *_widgets_to_items_hash_table = NULL;
17 17
18static char * 18static char *
19_item_label_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part) 19_item_label_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part)
@@ -290,6 +290,7 @@ objtree_list_unset()
290{ 290{
291 if (gl_root) elm_object_item_del(gl_root); 291 if (gl_root) elm_object_item_del(gl_root);
292 gl_root = NULL; 292 gl_root = NULL;
293 eina_hash_free(_widgets_to_items_hash_table);
293 elm_genlist_clear(lst); 294 elm_genlist_clear(lst);
294 lst = NULL; 295 lst = NULL;
295 if (_itc) elm_genlist_item_class_free(_itc); 296 if (_itc) elm_genlist_item_class_free(_itc);
diff --git a/src/lib/database.c b/src/lib/database.c
index 436583f..da46307 100644
--- a/src/lib/database.c
+++ b/src/lib/database.c
@@ -331,6 +331,7 @@ db_init()
331 class_props->inherit_containers = eina_list_append(class_props->inherit_containers, cont_class); 331 class_props->inherit_containers = eina_list_append(class_props->inherit_containers, cont_class);
332 } 332 }
333 } 333 }
334 eina_list_free(kl_list);
334 cl_p++; 335 cl_p++;
335 } 336 }
336 cl_p = NULL; 337 cl_p = NULL;
diff --git a/src/lib/gui_widget.c b/src/lib/gui_widget.c
index 93d72ef..bd7318f 100644
--- a/src/lib/gui_widget.c
+++ b/src/lib/gui_widget.c
@@ -330,12 +330,14 @@ Eina_Bool
330gui_context_del(Gui_Context *ctx) 330gui_context_del(Gui_Context *ctx)
331{ 331{
332 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, EINA_TRUE); 332 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, EINA_TRUE);
333 Eina_List *list, *l , *l2; 333 Eina_List *lst, *itr1 , *itr2;
334 Gui_Widget *wdg; 334 Gui_Widget *wdg;
335 Gui_Resource_Type type_itr;
336 Gui_Resource *res;
335 337
336 /* in editor, we iterate only over windows which don't have parent. */ 338 /* in editor, we iterate only over windows which don't have parent. */
337 list = gui_context_win_list_get(ctx); 339 lst = gui_context_win_list_get(ctx);
338 EINA_LIST_FOREACH_SAFE(list, l, l2, wdg) 340 EINA_LIST_FOREACH_SAFE(lst, itr1, itr2, wdg)
339 { 341 {
340 /* if window have parent widget, it will be iterated as child*/ 342 /* if window have parent widget, it will be iterated as child*/
341 if (wdg_parent_get(wdg)) continue; 343 if (wdg_parent_get(wdg)) continue;
@@ -345,11 +347,21 @@ gui_context_del(Gui_Context *ctx)
345 _iter_del_widget(wdg); 347 _iter_del_widget(wdg);
346 } 348 }
347 Gui_Sequence *seq; 349 Gui_Sequence *seq;
348 EINA_LIST_FOREACH_SAFE(gui_context_seq_list_get(ctx), l, l2, seq) 350 EINA_LIST_FOREACH_SAFE(gui_context_seq_list_get(ctx), itr1, itr2, seq)
349 { 351 {
350 sequence_del(seq); 352 sequence_del(seq);
351 } 353 }
352 354
355 for (type_itr = RESOURCE_STRING; type_itr < RESOURCE_SENTINEL; type_itr++)
356 {
357 lst = (Eina_List *) gui_context_resource_list_get(ctx, type_itr);
358 if (!lst) continue;
359 EINA_LIST_FOREACH_SAFE(lst, itr1, itr2, res)
360 {
361 gui_context_resource_del(res);
362 }
363 }
364
353 eina_hash_free(ctx->wdg_hash); 365 eina_hash_free(ctx->wdg_hash);
354 366
355 eina_list_free(ctx->wdg_list); 367 eina_list_free(ctx->wdg_list);