summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-05-29 17:46:12 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-05-29 17:46:12 +0300
commitb2f5dc1a68e01929a987ff5cb6a2140f0ca02fcc (patch)
tree1d2cb882511abc2ec292e95c7b21ace7228f8790
parent046e3e204015ab585f7bf7b186847924dff2edaf (diff)
Fix Valgrind issues
-rw-r--r--src/bin/main.c4
-rw-r--r--src/lib/generator.c15
-rw-r--r--src/lib/plugin_C.c9
3 files changed, 18 insertions, 10 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index eee2c78..39876bf 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -109,7 +109,9 @@ main(int argc, char **argv)
109 Generator_Export_Mode export_mode = GENERATE_NONE; 109 Generator_Export_Mode export_mode = GENERATE_NONE;
110 int i; 110 int i;
111 111
112#ifdef GUI_MODE
112 elm_init(argc, argv); 113 elm_init(argc, argv);
114#endif
113 115
114 if (!gui_parser_init()) 116 if (!gui_parser_init())
115 { 117 {
@@ -228,7 +230,9 @@ main(int argc, char **argv)
228 230
229end: 231end:
230 if (filename) free(filename); 232 if (filename) free(filename);
233#ifdef GUI_MODE
231 gui_parser_shutdown(); 234 gui_parser_shutdown();
235#endif
232 elm_shutdown(); 236 elm_shutdown();
233 return 0; 237 return 0;
234} 238}
diff --git a/src/lib/generator.c b/src/lib/generator.c
index 7dad05f..ef91faf 100644
--- a/src/lib/generator.c
+++ b/src/lib/generator.c
@@ -351,7 +351,7 @@ _function_ctx_free(Function_Context *foo_ctx)
351 free(vd); 351 free(vd);
352 } 352 }
353 353
354 free(foo_ctx->buf); 354 eina_strbuf_free(foo_ctx->buf);
355 free(foo_ctx); 355 free(foo_ctx);
356} 356}
357 357
@@ -640,11 +640,14 @@ _wdg_cb_add_generate(Gui_Session *session, const Gui_Widget *wdg, const Gui_Widg
640 640
641 if (_export_mode & GENERATE_CODE) 641 if (_export_mode & GENERATE_CODE)
642 { 642 {
643 const char *event_name = _c_plugin_eo_event_name_get(wdg_class_name_get(wdg), cb_type); 643 char *event_name = _c_plugin_eo_event_name_get(wdg_class_name_get(wdg), cb_type);
644 if (event_name) 644 if (event_name)
645 eina_strbuf_append_printf(foo_ctx->buf, " eo_do(%s, eo_event_callback_add(%s, %s, NULL));\n", 645 {
646 wdg_name_get(wdg), event_name, 646 eina_strbuf_append_printf(foo_ctx->buf, " eo_do(%s, eo_event_callback_add(%s, %s, NULL));\n",
647 cb_name); 647 wdg_name_get(wdg), event_name,
648 cb_name);
649 free(event_name);
650 }
648 } 651 }
649 652
650 return ret; 653 return ret;
@@ -846,7 +849,7 @@ _ctx_to_file_save(Gui_Context *ctx)
846 fprintf(fp_h, "%s", eina_strbuf_string_get(gl_gen_ctx.buf)); 849 fprintf(fp_h, "%s", eina_strbuf_string_get(gl_gen_ctx.buf));
847 } 850 }
848 851
849 free(gl_gen_ctx.buf); 852 eina_strbuf_free(gl_gen_ctx.buf);
850 EINA_LIST_FREE(gl_gen_ctx.public_names, vd) 853 EINA_LIST_FREE(gl_gen_ctx.public_names, vd)
851 { 854 {
852 free(vd->var_name); 855 free(vd->var_name);
diff --git a/src/lib/plugin_C.c b/src/lib/plugin_C.c
index 4b3ca45..e8acb5d 100644
--- a/src/lib/plugin_C.c
+++ b/src/lib/plugin_C.c
@@ -10,15 +10,15 @@
10static Eina_Strbuf * 10static Eina_Strbuf *
11_eo_event_name_get(const char *class_name, const char *event_name) 11_eo_event_name_get(const char *class_name, const char *event_name)
12{ 12{
13 Eina_List *classes = eo_class_mro_get(class_name); 13 Eina_List *classes = eo_class_mro_get(class_name), *itr;
14 const char *inherit; 14 const char *inherit;
15 15
16 EINA_LIST_FREE(classes, inherit) 16 EINA_LIST_FOREACH(classes, itr, inherit)
17 { 17 {
18 Eolian_Class class = eolian_class_find_by_name(inherit); 18 Eolian_Class class = eolian_class_find_by_name(inherit);
19 const Eina_List *events = eolian_class_events_list_get(class), *itr; 19 const Eina_List *events = eolian_class_events_list_get(class), *itr2;
20 Eolian_Event event; 20 Eolian_Event event;
21 EINA_LIST_FOREACH(events, itr, event) 21 EINA_LIST_FOREACH(events, itr2, event)
22 { 22 {
23 const char *ev_name; 23 const char *ev_name;
24 eolian_class_event_information_get(event, &ev_name, NULL, NULL); 24 eolian_class_event_information_get(event, &ev_name, NULL, NULL);
@@ -29,6 +29,7 @@ _eo_event_name_get(const char *class_name, const char *event_name)
29 eina_strbuf_replace_all(eo_event, ",", "_"); 29 eina_strbuf_replace_all(eo_event, ",", "_");
30 char *str = (char *)eina_strbuf_string_get(eo_event); 30 char *str = (char *)eina_strbuf_string_get(eo_event);
31 eina_str_toupper(&str); 31 eina_str_toupper(&str);
32 eina_list_free(classes);
32 return eo_event; 33 return eo_event;
33 } 34 }
34 } 35 }