summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-01-22 11:14:23 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-01-22 11:14:33 +0900
commit7d689a4121779c0f456c68561ccfce5534c35820 (patch)
tree4863336f4eb04b5588441986b1b239fa0612bce3
parentb2842f5a940d0344ea2f8bf0cdb06dae981f9726 (diff)
parentac5d368b190eaa7920d43bd9253adf5c13e84340 (diff)
elm: Removed unnecessary null checks.
As all efl public free apis and free function get null as valid parameter, we do not need to check null. I also used ELM_SAFE_FREE if necessary. After this job code got cleaner. This is a continue of a commit e3372339.
-rw-r--r--src/lib/elc_ctxpopup.c14
-rw-r--r--src/lib/elc_fileselector.c12
-rw-r--r--src/lib/elc_fileselector_button.c6
-rw-r--r--src/lib/elc_fileselector_entry.c4
-rw-r--r--src/lib/elc_hoversel.c3
-rw-r--r--src/lib/elc_multibuttonentry.c10
-rw-r--r--src/lib/elc_naviframe.c8
-rw-r--r--src/lib/elc_player.c3
-rw-r--r--src/lib/elc_popup.c22
-rw-r--r--src/lib/elm_access.c10
-rw-r--r--src/lib/elm_atspi_object.c4
-rw-r--r--src/lib/elm_bg.c6
-rw-r--r--src/lib/elm_clock.c14
-rw-r--r--src/lib/elm_cnp.c26
-rw-r--r--src/lib/elm_colorselector.c31
-rw-r--r--src/lib/elm_config.c31
-rw-r--r--src/lib/elm_conform.c2
-rw-r--r--src/lib/elm_dbus_menu.c6
-rw-r--r--src/lib/elm_diskselector.c25
-rw-r--r--src/lib/elm_entry.c49
-rw-r--r--src/lib/elm_factory.c2
-rw-r--r--src/lib/elm_flip.c5
-rw-r--r--src/lib/elm_font.c8
-rw-r--r--src/lib/elm_gengrid.c2
-rw-r--r--src/lib/elm_genlist.c26
-rw-r--r--src/lib/elm_glview.c11
-rw-r--r--src/lib/elm_hover.c8
-rw-r--r--src/lib/elm_icon.c12
-rw-r--r--src/lib/elm_image.c14
-rw-r--r--src/lib/elm_index.c21
-rw-r--r--src/lib/elm_interface_scrollable.c28
-rw-r--r--src/lib/elm_list.c6
-rw-r--r--src/lib/elm_main.c32
-rw-r--r--src/lib/elm_map.c60
-rw-r--r--src/lib/elm_mapbuf.c5
-rw-r--r--src/lib/elm_menu.c23
-rw-r--r--src/lib/elm_module.c6
-rw-r--r--src/lib/elm_notify.c2
-rw-r--r--src/lib/elm_photocam.c16
-rw-r--r--src/lib/elm_prefs.c10
-rw-r--r--src/lib/elm_prefs_data.c6
-rw-r--r--src/lib/elm_progressbar.c2
-rw-r--r--src/lib/elm_scroller.c2
-rw-r--r--src/lib/elm_segment_control.c6
-rw-r--r--src/lib/elm_slideshow.c5
-rw-r--r--src/lib/elm_store.c4
-rw-r--r--src/lib/elm_theme.c2
-rw-r--r--src/lib/elm_thumb.c23
-rw-r--r--src/lib/elm_toolbar.c23
-rw-r--r--src/lib/elm_transit.c8
-rw-r--r--src/lib/elm_widget.c17
-rw-r--r--src/lib/elm_win.c30
-rw-r--r--src/lib/els_cursor.c12
-rw-r--r--src/lib/els_tooltip.c3
54 files changed, 267 insertions, 459 deletions
diff --git a/src/lib/elc_ctxpopup.c b/src/lib/elc_ctxpopup.c
index 4900765aa..ee756f657 100644
--- a/src/lib/elc_ctxpopup.c
+++ b/src/lib/elc_ctxpopup.c
@@ -786,7 +786,7 @@ _elm_ctxpopup_smart_content_set(Eo *obj, void *_pd, va_list *list)
786 786
787 if (content == sd->content) goto end; 787 if (content == sd->content) goto end;
788 788
789 if (sd->content) evas_object_del(sd->content); 789 evas_object_del(sd->content);
790 if (sd->content == sd->list) sd->list = NULL; 790 if (sd->content == sd->list) sd->list = NULL;
791 791
792 evas_object_size_hint_weight_set 792 evas_object_size_hint_weight_set
@@ -1040,10 +1040,7 @@ _list_resize_cb(void *data,
1040static void 1040static void
1041_list_del(Elm_Ctxpopup_Smart_Data *sd) 1041_list_del(Elm_Ctxpopup_Smart_Data *sd)
1042{ 1042{
1043 if (!sd->list) return; 1043 ELM_SAFE_FREE(sd->list, evas_object_del);
1044
1045 evas_object_del(sd->list);
1046 sd->list = NULL;
1047} 1044}
1048 1045
1049static Eina_Bool 1046static Eina_Bool
@@ -1158,11 +1155,8 @@ _elm_ctxpopup_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1158 _parent_detach(obj); 1155 _parent_detach(obj);
1159 1156
1160 elm_ctxpopup_clear(obj); 1157 elm_ctxpopup_clear(obj);
1161 evas_object_del(sd->arrow); 1158 ELM_SAFE_FREE(sd->arrow, evas_object_del); /* stops _sizing_eval() from going on on deletion */
1162 sd->arrow = NULL; /* stops _sizing_eval() from going on on deletion */ 1159 ELM_SAFE_FREE(sd->bg, evas_object_del);
1163
1164 evas_object_del(sd->bg);
1165 sd->bg = NULL;
1166 1160
1167 EINA_LIST_FREE(sd->items, it) 1161 EINA_LIST_FREE(sd->items, it)
1168 elm_widget_item_free(it); 1162 elm_widget_item_free(it);
diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c
index ab6f051f4..dcd9ad796 100644
--- a/src/lib/elc_fileselector.c
+++ b/src/lib/elc_fileselector.c
@@ -46,9 +46,9 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
46static void 46static void
47_elm_fileselector_smart_del_do(Elm_Fileselector_Smart_Data *sd) 47_elm_fileselector_smart_del_do(Elm_Fileselector_Smart_Data *sd)
48{ 48{
49 if (sd->path) eina_stringshare_del(sd->path); 49 eina_stringshare_del(sd->path);
50 if (sd->selection) eina_stringshare_del(sd->selection); 50 eina_stringshare_del(sd->selection);
51 if (sd->populate_idler) free(ecore_idler_del(sd->populate_idler)); 51 free(ecore_idler_del(sd->populate_idler));
52 52
53 eo_do_super(sd->obj, MY_CLASS, evas_obj_smart_del()); 53 eo_do_super(sd->obj, MY_CLASS, evas_obj_smart_del());
54} 54}
@@ -1583,10 +1583,8 @@ _buttons_ok_cancel_set(Eo *obj, void *_pd, va_list *list)
1583 } 1583 }
1584 else if (!visible) 1584 else if (!visible)
1585 { 1585 {
1586 evas_object_del(sd->cancel_button); 1586 ELM_SAFE_FREE(sd->cancel_button, evas_object_del);
1587 sd->cancel_button = NULL; 1587 ELM_SAFE_FREE(sd->ok_button, evas_object_del);
1588 evas_object_del(sd->ok_button);
1589 sd->ok_button = NULL;
1590 } 1588 }
1591} 1589}
1592 1590
diff --git a/src/lib/elc_fileselector_button.c b/src/lib/elc_fileselector_button.c
index 363c9a311..40c12b5a9 100644
--- a/src/lib/elc_fileselector_button.c
+++ b/src/lib/elc_fileselector_button.c
@@ -201,9 +201,9 @@ _elm_fileselector_button_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED
201{ 201{
202 Elm_Fileselector_Button_Smart_Data *sd = _pd; 202 Elm_Fileselector_Button_Smart_Data *sd = _pd;
203 203
204 if (sd->window_title) eina_stringshare_del(sd->window_title); 204 eina_stringshare_del(sd->window_title);
205 if (sd->fsd.path) eina_stringshare_del(sd->fsd.path); 205 eina_stringshare_del(sd->fsd.path);
206 if (sd->fsw) evas_object_del(sd->fsw); 206 evas_object_del(sd->fsw);
207 207
208 eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); 208 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
209} 209}
diff --git a/src/lib/elc_fileselector_entry.c b/src/lib/elc_fileselector_entry.c
index 05e9a68cc..0431189dc 100644
--- a/src/lib/elc_fileselector_entry.c
+++ b/src/lib/elc_fileselector_entry.c
@@ -397,7 +397,7 @@ _elm_fileselector_entry_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
397{ 397{
398 Elm_Fileselector_Entry_Smart_Data *sd = _pd; 398 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
399 399
400 if (sd->path) free(sd->path); 400 free(sd->path);
401 401
402 eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); 402 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
403} 403}
@@ -569,7 +569,7 @@ _path_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
569 const char **ret = va_arg(*list, const char **); 569 const char **ret = va_arg(*list, const char **);
570 Elm_Fileselector_Entry_Smart_Data *sd = _pd; 570 Elm_Fileselector_Entry_Smart_Data *sd = _pd;
571 571
572 if (sd->path) free(sd->path); 572 free(sd->path);
573 sd->path = elm_entry_markup_to_utf8(elm_object_text_get(sd->entry)); 573 sd->path = elm_entry_markup_to_utf8(elm_object_text_get(sd->entry));
574 *ret = sd->path; 574 *ret = sd->path;
575} 575}
diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c
index a472122bf..d0321a99f 100644
--- a/src/lib/elc_hoversel.c
+++ b/src/lib/elc_hoversel.c
@@ -449,8 +449,7 @@ _hover_end(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
449 { 449 {
450 VIEW(it) = NULL; 450 VIEW(it) = NULL;
451 } 451 }
452 evas_object_del(sd->hover); 452 ELM_SAFE_FREE(sd->hover, evas_object_del);
453 sd->hover = NULL;
454 453
455 evas_object_smart_callback_call(obj, SIG_DISMISSED, NULL); 454 evas_object_smart_callback_call(obj, SIG_DISMISSED, NULL);
456} 455}
diff --git a/src/lib/elc_multibuttonentry.c b/src/lib/elc_multibuttonentry.c
index 62dc1d127..c89e2feee 100644
--- a/src/lib/elc_multibuttonentry.c
+++ b/src/lib/elc_multibuttonentry.c
@@ -1530,12 +1530,12 @@ _elm_multibuttonentry_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1530 1530
1531 sd->selected_it = NULL; 1531 sd->selected_it = NULL;
1532 1532
1533 if (sd->label_str) eina_stringshare_del(sd->label_str); 1533 eina_stringshare_del(sd->label_str);
1534 if (sd->guide_text_str) eina_stringshare_del(sd->guide_text_str); 1534 eina_stringshare_del(sd->guide_text_str);
1535 evas_object_del(sd->entry); 1535 evas_object_del(sd->entry);
1536 if (sd->label) evas_object_del(sd->label); 1536 evas_object_del(sd->label);
1537 if (sd->guide_text) evas_object_del(sd->guide_text); 1537 evas_object_del(sd->guide_text);
1538 if (sd->end) evas_object_del(sd->end); 1538 evas_object_del(sd->end);
1539 1539
1540 eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); 1540 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
1541} 1541}
diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c
index 6143f2ae0..7441a0245 100644
--- a/src/lib/elc_naviframe.c
+++ b/src/lib/elc_naviframe.c
@@ -548,7 +548,7 @@ _item_content_set(Elm_Naviframe_Item *it,
548{ 548{
549 if (it->content == content) return; 549 if (it->content == content) return;
550 550
551 if (it->content) evas_object_del(it->content); 551 evas_object_del(it->content);
552 it->content = content; 552 it->content = content;
553 553
554 if (!content) return; 554 if (!content) return;
@@ -565,7 +565,7 @@ _item_title_prev_btn_set(Elm_Naviframe_Item *it,
565 Evas_Object *btn) 565 Evas_Object *btn)
566{ 566{
567 if (it->title_prev_btn == btn) return; 567 if (it->title_prev_btn == btn) return;
568 if (it->title_prev_btn) evas_object_del(it->title_prev_btn); 568 evas_object_del(it->title_prev_btn);
569 it->title_prev_btn = btn; 569 it->title_prev_btn = btn;
570 if (!btn) return; 570 if (!btn) return;
571 571
@@ -582,7 +582,7 @@ _item_title_next_btn_set(Elm_Naviframe_Item *it,
582 Evas_Object *btn) 582 Evas_Object *btn)
583{ 583{
584 if (it->title_next_btn == btn) return; 584 if (it->title_next_btn == btn) return;
585 if (it->title_next_btn) evas_object_del(it->title_next_btn); 585 evas_object_del(it->title_next_btn);
586 it->title_next_btn = btn; 586 it->title_next_btn = btn;
587 if (!btn) return; 587 if (!btn) return;
588 588
@@ -598,7 +598,7 @@ _item_title_icon_set(Elm_Naviframe_Item *it,
598 Evas_Object *icon) 598 Evas_Object *icon)
599{ 599{
600 if (it->title_icon == icon) return; 600 if (it->title_icon == icon) return;
601 if (it->title_icon) evas_object_del(it->title_icon); 601 evas_object_del(it->title_icon);
602 it->title_icon = icon; 602 it->title_icon = icon;
603 if (!icon) return; 603 if (!icon) return;
604 604
diff --git a/src/lib/elc_player.c b/src/lib/elc_player.c
index 0d39dfa49..2b6eff387 100644
--- a/src/lib/elc_player.c
+++ b/src/lib/elc_player.c
@@ -563,8 +563,7 @@ _elm_player_smart_content_set(Eo *obj, void *_pd, va_list *list)
563 if (!_elm_video_check(content)) return; 563 if (!_elm_video_check(content)) return;
564 if (sd->video == content) goto end; 564 if (sd->video == content) goto end;
565 565
566 if (sd->video) evas_object_del(sd->video); 566 evas_object_del(sd->video);
567
568 sd->video = content; 567 sd->video = content;
569 568
570 if (!content) goto end; 569 if (!content) goto end;
diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c
index f9806aeae..640134c09 100644
--- a/src/lib/elc_popup.c
+++ b/src/lib/elc_popup.c
@@ -188,11 +188,10 @@ _list_del(Elm_Popup_Smart_Data *sd)
188 evas_object_event_callback_del 188 evas_object_event_callback_del
189 (sd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb); 189 (sd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb);
190 190
191 evas_object_del(sd->tbl); 191 ELM_SAFE_FREE(sd->tbl, evas_object_del);
192 sd->scr = NULL; 192 sd->scr = NULL;
193 sd->box = NULL; 193 sd->box = NULL;
194 sd->spacer = NULL; 194 sd->spacer = NULL;
195 sd->tbl = NULL;
196} 195}
197 196
198static void 197static void
@@ -229,8 +228,7 @@ _elm_popup_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
229 if (sd->buttons[i]) 228 if (sd->buttons[i])
230 { 229 {
231 evas_object_del(sd->buttons[i]->btn); 230 evas_object_del(sd->buttons[i]->btn);
232 free(sd->buttons[i]); 231 ELM_SAFE_FREE(sd->buttons[i], free);
233 sd->buttons[i] = NULL;
234 } 232 }
235 } 233 }
236 if (sd->items) 234 if (sd->items)
@@ -580,8 +578,7 @@ _button_remove(Evas_Object *obj,
580 if (!sd->last_button_number) 578 if (!sd->last_button_number)
581 { 579 {
582 _visuals_set(obj); 580 _visuals_set(obj);
583 evas_object_del(sd->action_area); 581 ELM_SAFE_FREE(sd->action_area, evas_object_del);
584 sd->action_area = NULL;
585 edje_object_message_signal_process(wd->resize_obj); 582 edje_object_message_signal_process(wd->resize_obj);
586 } 583 }
587 else 584 else
@@ -728,9 +725,7 @@ _item_icon_set(Elm_Popup_Item *it,
728{ 725{
729 if (it->icon == icon) return; 726 if (it->icon == icon) return;
730 727
731 if (it->icon) 728 evas_object_del(it->icon);
732 evas_object_del(it->icon);
733
734 it->icon = icon; 729 it->icon = icon;
735 if (it->icon) 730 if (it->icon)
736 { 731 {
@@ -829,9 +824,7 @@ _item_del_pre_hook(Elm_Object_Item *item)
829 ELM_POPUP_ITEM_CHECK_OR_RETURN(it); 824 ELM_POPUP_ITEM_CHECK_OR_RETURN(it);
830 ELM_POPUP_DATA_GET(WIDGET(it), sd); 825 ELM_POPUP_DATA_GET(WIDGET(it), sd);
831 826
832 if (it->icon) 827 evas_object_del(it->icon);
833 evas_object_del(it->icon);
834
835 eina_stringshare_del(it->label); 828 eina_stringshare_del(it->label);
836 sd->items = eina_list_remove(sd->items, it); 829 sd->items = eina_list_remove(sd->items, it);
837 if (!eina_list_count(sd->items)) 830 if (!eina_list_count(sd->items))
@@ -1048,7 +1041,7 @@ _title_icon_set(Evas_Object *obj,
1048 1041
1049 if (sd->title_icon == icon) return EINA_TRUE; 1042 if (sd->title_icon == icon) return EINA_TRUE;
1050 title_visibility_old = (sd->title_text) || (sd->title_icon); 1043 title_visibility_old = (sd->title_text) || (sd->title_icon);
1051 if (sd->title_icon) evas_object_del(sd->title_icon); 1044 evas_object_del(sd->title_icon);
1052 1045
1053 sd->title_icon = icon; 1046 sd->title_icon = icon;
1054 title_visibility_current = (sd->title_text) || (sd->title_icon); 1047 title_visibility_current = (sd->title_text) || (sd->title_icon);
@@ -1914,8 +1907,7 @@ _item_append(Eo *obj, void *_pd, va_list *list)
1914 { 1907 {
1915 prev_content = elm_layout_content_get 1908 prev_content = elm_layout_content_get
1916 (sd->content_area, CONTENT_PART); 1909 (sd->content_area, CONTENT_PART);
1917 if (prev_content) 1910 evas_object_del(prev_content);
1918 evas_object_del(prev_content);
1919 } 1911 }
1920 1912
1921 //The first item is appended. 1913 //The first item is appended.
diff --git a/src/lib/elm_access.c b/src/lib/elm_access.c
index 68dad7aeb..b9dd1de4a 100644
--- a/src/lib/elm_access.c
+++ b/src/lib/elm_access.c
@@ -68,7 +68,7 @@ _access_action_callback_call(Evas_Object *obj,
68 if (a && (a->fn[type].cb)) 68 if (a && (a->fn[type].cb))
69 ret = a->fn[type].cb(a->fn[type].user_data, obj, action_info); 69 ret = a->fn[type].cb(a->fn[type].user_data, obj, action_info);
70 70
71 if (ai) free(ai); 71 free(ai);
72 72
73 return ret; 73 return ret;
74} 74}
@@ -210,7 +210,7 @@ _access_add_set(Elm_Access_Info *ac, int type)
210 { 210 {
211 if (!ai->func) 211 if (!ai->func)
212 { 212 {
213 if (ai->data) eina_stringshare_del(ai->data); 213 eina_stringshare_del(ai->data);
214 } 214 }
215 ai->func = NULL; 215 ai->func = NULL;
216 ai->data = NULL; 216 ai->data = NULL;
@@ -571,7 +571,7 @@ _elm_access_clear(Elm_Access_Info *ac)
571 { 571 {
572 if (!ai->func) 572 if (!ai->func)
573 { 573 {
574 if (ai->data) eina_stringshare_del(ai->data); 574 eina_stringshare_del(ai->data);
575 } 575 }
576 free(ai); 576 free(ai);
577 } 577 }
@@ -738,7 +738,7 @@ _elm_access_read(Elm_Access_Info *ac, int type, const Evas_Object *obj)
738 } 738 }
739 } 739 }
740 } 740 }
741 if (txt) free(txt); 741 free(txt);
742} 742}
743 743
744EAPI void 744EAPI void
@@ -1118,7 +1118,7 @@ _elm_access_object_unregister(Evas_Object *obj, Evas_Object *hoverobj)
1118 Action_Info *a; 1118 Action_Info *a;
1119 a = evas_object_data_get(obj, "_elm_access_action_info"); 1119 a = evas_object_data_get(obj, "_elm_access_action_info");
1120 evas_object_data_del(obj, "_elm_access_action_info"); 1120 evas_object_data_del(obj, "_elm_access_action_info");
1121 if (a) free(a); 1121 free(a);
1122} 1122}
1123 1123
1124EAPI void 1124EAPI void
diff --git a/src/lib/elm_atspi_object.c b/src/lib/elm_atspi_object.c
index ab7979c28..612130a0c 100644
--- a/src/lib/elm_atspi_object.c
+++ b/src/lib/elm_atspi_object.c
@@ -212,8 +212,8 @@ _destructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
212{ 212{
213 Atspi_Object_Data *ad = _pd; 213 Atspi_Object_Data *ad = _pd;
214 214
215 if (ad->name) eina_stringshare_del(ad->name); 215 eina_stringshare_del(ad->name);
216 if (ad->description) eina_stringshare_del(ad->description); 216 eina_stringshare_del(ad->description);
217 217
218 eo_do_super(obj, ELM_ATSPI_CLASS, eo_destructor()); 218 eo_do_super(obj, ELM_ATSPI_CLASS, eo_destructor());
219} 219}
diff --git a/src/lib/elm_bg.c b/src/lib/elm_bg.c
index 3c404517b..ef8792d66 100644
--- a/src/lib/elm_bg.c
+++ b/src/lib/elm_bg.c
@@ -177,11 +177,7 @@ _file_set(Eo *obj, void *_pd, va_list *list)
177 const char *p; 177 const char *p;
178 Eina_Bool int_ret; 178 Eina_Bool int_ret;
179 179
180 if (sd->img) 180 ELM_SAFE_FREE(sd->img, evas_object_del);
181 {
182 evas_object_del(sd->img);
183 sd->img = NULL;
184 }
185 if (!file) 181 if (!file)
186 { 182 {
187 ELM_SAFE_FREE(sd->file, eina_stringshare_del); 183 ELM_SAFE_FREE(sd->file, eina_stringshare_del);
diff --git a/src/lib/elm_clock.c b/src/lib/elm_clock.c
index 51b2b4fd8..c63c7e030 100644
--- a/src/lib/elm_clock.c
+++ b/src/lib/elm_clock.c
@@ -352,18 +352,8 @@ _time_update(Evas_Object *obj)
352 Evas_Coord mw, mh; 352 Evas_Coord mw, mh;
353 353
354 for (i = 0; i < 6; i++) 354 for (i = 0; i < 6; i++)
355 { 355 ELM_SAFE_FREE(sd->digit[i], evas_object_del);
356 if (sd->digit[i]) 356 ELM_SAFE_FREE(sd->am_pm_obj, evas_object_del);
357 {
358 evas_object_del(sd->digit[i]);
359 sd->digit[i] = NULL;
360 }
361 }
362 if (sd->am_pm_obj)
363 {
364 evas_object_del(sd->am_pm_obj);
365 sd->am_pm_obj = NULL;
366 }
367 357
368 if ((sd->seconds) && (sd->am_pm)) 358 if ((sd->seconds) && (sd->am_pm))
369 { 359 {
diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index daca9fb83..5efcd05e2 100644
--- a/src/lib/elm_cnp.c
+++ b/src/lib/elm_cnp.c
@@ -936,7 +936,7 @@ _x11_notify_handler_uri(X11_Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *
936 cnp_debug("Couldn't find a file\n"); 936 cnp_debug("Couldn't find a file\n");
937 return 0; 937 return 0;
938 } 938 }
939 if (savedtypes.imgfile) free(savedtypes.imgfile); 939 free(savedtypes.imgfile);
940 if (savedtypes.textreq) 940 if (savedtypes.textreq)
941 { 941 {
942 savedtypes.textreq = 0; 942 savedtypes.textreq = 0;
@@ -1270,7 +1270,7 @@ _x11_dnd_enter(void *data EINA_UNUSED, int etype EINA_UNUSED, void *ev)
1270 1270
1271 cnp_debug("Types\n"); 1271 cnp_debug("Types\n");
1272 savedtypes.ntypes = enter->num_types; 1272 savedtypes.ntypes = enter->num_types;
1273 if (savedtypes.types) free(savedtypes.types); 1273 free(savedtypes.types);
1274 savedtypes.types = malloc(sizeof(char *) * enter->num_types); 1274 savedtypes.types = malloc(sizeof(char *) * enter->num_types);
1275 if (!savedtypes.types) return EINA_FALSE; 1275 if (!savedtypes.types) return EINA_FALSE;
1276 1276
@@ -1284,8 +1284,7 @@ _x11_dnd_enter(void *data EINA_UNUSED, int etype EINA_UNUSED, void *ev)
1284 /* Request it, so we know what it is */ 1284 /* Request it, so we know what it is */
1285 cnp_debug("Sending uri request\n"); 1285 cnp_debug("Sending uri request\n");
1286 savedtypes.textreq = 1; 1286 savedtypes.textreq = 1;
1287 if (savedtypes.imgfile) free(savedtypes.imgfile); 1287 ELM_SAFE_FREE(savedtypes.imgfile, free);
1288 savedtypes.imgfile = NULL;
1289 ecore_x_selection_xdnd_request(enter->win, text_uri); 1288 ecore_x_selection_xdnd_request(enter->win, text_uri);
1290 } 1289 }
1291 } 1290 }
@@ -2303,7 +2302,7 @@ _wl_elm_cnp_selection_set(Evas_Object *obj, Elm_Sel_Type selection, Elm_Sel_Form
2303 2302
2304 ecore_wl_dnd_selection_set(ecore_wl_input_get(), types); 2303 ecore_wl_dnd_selection_set(ecore_wl_input_get(), types);
2305 2304
2306 if (sel->selbuf) free(sel->selbuf); 2305 free(sel->selbuf);
2307 sel->buflen = buflen; 2306 sel->buflen = buflen;
2308 sel->selbuf = strdup((char*)selbuf); 2307 sel->selbuf = strdup((char*)selbuf);
2309 2308
@@ -2658,8 +2657,7 @@ _wl_elm_drop_target_del(Evas_Object *obj, Elm_Sel_Format format,
2658 { 2657 {
2659 drops = eina_list_remove(drops, dropable); 2658 drops = eina_list_remove(drops, dropable);
2660 eo_do(obj, eo_base_data_del("__elm_dropable")); 2659 eo_do(obj, eo_base_data_del("__elm_dropable"));
2661 free(dropable); 2660 ELM_SAFE_FREE(dropable, free);
2662 dropable = NULL;
2663 evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL, 2661 evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL,
2664 _all_drop_targets_cbs_del); 2662 _all_drop_targets_cbs_del);
2665 } 2663 }
@@ -2708,7 +2706,7 @@ _wl_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format EINA_UNUSED, const ch
2708 ecore_wl_dnd_drag_types_set(ecore_wl_input_get(), types); 2706 ecore_wl_dnd_drag_types_set(ecore_wl_input_get(), types);
2709 2707
2710 /* set the drag data used when a drop occurs */ 2708 /* set the drag data used when a drop occurs */
2711 if (wl_cnp_selection.selbuf) free(wl_cnp_selection.selbuf); 2709 free(wl_cnp_selection.selbuf);
2712 wl_cnp_selection.selbuf = strdup((char*)data); 2710 wl_cnp_selection.selbuf = strdup((char*)data);
2713 wl_cnp_selection.buflen = strlen(wl_cnp_selection.selbuf); 2711 wl_cnp_selection.buflen = strlen(wl_cnp_selection.selbuf);
2714 2712
@@ -2801,7 +2799,7 @@ _wl_dnd_enter(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
2801 if ((!ev->num_types) || (!ev->types)) return ECORE_CALLBACK_PASS_ON; 2799 if ((!ev->num_types) || (!ev->types)) return ECORE_CALLBACK_PASS_ON;
2802 2800
2803 savedtypes.ntypes = ev->num_types; 2801 savedtypes.ntypes = ev->num_types;
2804 if (savedtypes.types) free(savedtypes.types); 2802 free(savedtypes.types);
2805 savedtypes.types = malloc(sizeof(char *) * ev->num_types); 2803 savedtypes.types = malloc(sizeof(char *) * ev->num_types);
2806 if (!savedtypes.types) return EINA_FALSE; 2804 if (!savedtypes.types) return EINA_FALSE;
2807 2805
@@ -2811,8 +2809,7 @@ _wl_dnd_enter(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
2811 if (savedtypes.types[i] == text_uri) 2809 if (savedtypes.types[i] == text_uri)
2812 { 2810 {
2813 savedtypes.textreq = 1; 2811 savedtypes.textreq = 1;
2814 if (savedtypes.imgfile) free(savedtypes.imgfile); 2812 ELM_SAFE_FREE(savedtypes.imgfile, free);
2815 savedtypes.imgfile = NULL;
2816 } 2813 }
2817 } 2814 }
2818 2815
@@ -3376,8 +3373,7 @@ _local_elm_cnp_selection_set(Evas_Object *obj EINA_UNUSED,
3376 const void *selbuf, size_t buflen) 3373 const void *selbuf, size_t buflen)
3377{ 3374{
3378 _local_elm_cnp_init(); 3375 _local_elm_cnp_init();
3379 if (_local_selinfo[selection].sel.buf) 3376 free(_local_selinfo[selection].sel.buf);
3380 free(_local_selinfo[selection].sel.buf);
3381 _local_selinfo[selection].format = format; 3377 _local_selinfo[selection].format = format;
3382 _local_selinfo[selection].sel.buf = malloc(buflen + 1); 3378 _local_selinfo[selection].sel.buf = malloc(buflen + 1);
3383 if (_local_selinfo[selection].sel.buf) 3379 if (_local_selinfo[selection].sel.buf)
@@ -3407,9 +3403,7 @@ _local_elm_object_cnp_selection_clear(Evas_Object *obj EINA_UNUSED,
3407 Elm_Sel_Type selection) 3403 Elm_Sel_Type selection)
3408{ 3404{
3409 _local_elm_cnp_init(); 3405 _local_elm_cnp_init();
3410 if (_local_selinfo[selection].sel.buf) 3406 ELM_SAFE_FREE(_local_selinfo[selection].sel.buf, free);
3411 free(_local_selinfo[selection].sel.buf);
3412 _local_selinfo[selection].sel.buf = NULL;
3413 _local_selinfo[selection].sel.size = 0; 3407 _local_selinfo[selection].sel.size = 0;
3414 return EINA_TRUE; 3408 return EINA_TRUE;
3415} 3409}
diff --git a/src/lib/elm_colorselector.c b/src/lib/elm_colorselector.c
index 2c5cc20da..9efb49538 100644
--- a/src/lib/elm_colorselector.c
+++ b/src/lib/elm_colorselector.c
@@ -1113,23 +1113,14 @@ _elm_colorselector_smart_theme(Eo *obj, void *_pd, va_list *list)
1113 { 1113 {
1114 if (sd->cb_data[i]) 1114 if (sd->cb_data[i])
1115 { 1115 {
1116 evas_object_del(sd->cb_data[i]->colorbar); 1116 ELM_SAFE_FREE(sd->cb_data[i]->colorbar, evas_object_del);
1117 sd->cb_data[i]->colorbar = NULL; 1117 ELM_SAFE_FREE(sd->cb_data[i]->bar, evas_object_del);
1118 evas_object_del(sd->cb_data[i]->bar); 1118 ELM_SAFE_FREE(sd->cb_data[i]->lbt, evas_object_del);
1119 sd->cb_data[i]->bar = NULL; 1119 ELM_SAFE_FREE(sd->cb_data[i]->rbt, evas_object_del);
1120 evas_object_del(sd->cb_data[i]->lbt);
1121 sd->cb_data[i]->lbt = NULL;
1122 evas_object_del(sd->cb_data[i]->rbt);
1123 sd->cb_data[i]->rbt = NULL;
1124 if (i != 0) 1120 if (i != 0)
1125 { 1121 ELM_SAFE_FREE(sd->cb_data[i]->bg_rect, evas_object_del);
1126 evas_object_del(sd->cb_data[i]->bg_rect); 1122 ELM_SAFE_FREE(sd->cb_data[i]->arrow, evas_object_del);
1127 sd->cb_data[i]->bg_rect = NULL; 1123 ELM_SAFE_FREE(sd->cb_data[i]->touch_area, evas_object_del);
1128 }
1129 evas_object_del(sd->cb_data[i]->arrow);
1130 sd->cb_data[i]->arrow = NULL;
1131 evas_object_del(sd->cb_data[i]->touch_area);
1132 sd->cb_data[i]->touch_area = NULL;
1133 } 1124 }
1134 } 1125 }
1135 1126
@@ -1587,12 +1578,12 @@ _elm_colorselector_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1587 evas_event_callback_del_full(evas_object_evas_get(obj), EVAS_CALLBACK_CANVAS_FOCUS_OUT, _mouse_out_canvas, obj); 1578 evas_event_callback_del_full(evas_object_evas_get(obj), EVAS_CALLBACK_CANVAS_FOCUS_OUT, _mouse_out_canvas, obj);
1588 1579
1589 ecore_timer_del(sd->longpress_timer); 1580 ecore_timer_del(sd->longpress_timer);
1590 if (sd->palette_name) eina_stringshare_del(sd->palette_name); 1581 eina_stringshare_del(sd->palette_name);
1591 1582
1592#ifdef HAVE_ELEMENTARY_X 1583#ifdef HAVE_ELEMENTARY_X
1593 if (sd->grab.mouse_motion) ecore_event_handler_del(sd->grab.mouse_motion); 1584 ecore_event_handler_del(sd->grab.mouse_motion);
1594 if (sd->grab.mouse_up) ecore_event_handler_del(sd->grab.mouse_up); 1585 ecore_event_handler_del(sd->grab.mouse_up);
1595 if (sd->grab.key_up) ecore_event_handler_del(sd->grab.key_up); 1586 ecore_event_handler_del(sd->grab.key_up);
1596#endif 1587#endif
1597 1588
1598 _items_del(sd); 1589 _items_del(sd);
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index 222e04a0e..286e2227c 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -213,7 +213,7 @@ _prop_change_delay_cb(void *data EINA_UNUSED)
213 s = ecore_x_window_prop_string_get(_config_win, _atom[ATOM_E_PROFILE]); 213 s = ecore_x_window_prop_string_get(_config_win, _atom[ATOM_E_PROFILE]);
214 if (s) 214 if (s)
215 { 215 {
216 if (_elm_profile) free(_elm_profile); 216 free(_elm_profile);
217 _elm_profile = s; 217 _elm_profile = s;
218 } 218 }
219 } 219 }
@@ -651,7 +651,7 @@ _elm_config_font_overlay_set(const char *text_class,
651 if (strcmp(efd->text_class, text_class)) 651 if (strcmp(efd->text_class, text_class))
652 continue; 652 continue;
653 653
654 if (efd->font) eina_stringshare_del(efd->font); 654 eina_stringshare_del(efd->font);
655 efd->font = eina_stringshare_add(font); 655 efd->font = eina_stringshare_add(font);
656 efd->size = size; 656 efd->size = size;
657 _elm_config->font_overlays = 657 _elm_config->font_overlays =
@@ -686,7 +686,7 @@ _elm_config_font_overlay_remove(const char *text_class)
686 _elm_config->font_overlays = 686 _elm_config->font_overlays =
687 eina_list_remove_list(_elm_config->font_overlays, l); 687 eina_list_remove_list(_elm_config->font_overlays, l);
688 eina_stringshare_del(efd->text_class); 688 eina_stringshare_del(efd->text_class);
689 if (efd->font) eina_stringshare_del(efd->font); 689 eina_stringshare_del(efd->font);
690 free(efd); 690 free(efd);
691 691
692 return; 692 return;
@@ -968,25 +968,25 @@ _config_free(Elm_Config *cfg)
968 { 968 {
969 eina_stringshare_del(fontdir); 969 eina_stringshare_del(fontdir);
970 } 970 }
971 if (cfg->engine) eina_stringshare_del(cfg->engine); 971 eina_stringshare_del(cfg->engine);
972 EINA_LIST_FREE(cfg->font_overlays, fo) 972 EINA_LIST_FREE(cfg->font_overlays, fo)
973 { 973 {
974 if (fo->text_class) eina_stringshare_del(fo->text_class); 974 eina_stringshare_del(fo->text_class);
975 if (fo->font) eina_stringshare_del(fo->font); 975 eina_stringshare_del(fo->font);
976 free(fo); 976 free(fo);
977 } 977 }
978 EINA_LIST_FREE(cfg->color_palette, palette) 978 EINA_LIST_FREE(cfg->color_palette, palette)
979 { 979 {
980 if (palette->palette_name) eina_stringshare_del(palette->palette_name); 980 eina_stringshare_del(palette->palette_name);
981 EINA_LIST_FREE(palette->color_list, color) free(color); 981 EINA_LIST_FREE(palette->color_list, color) free(color);
982 free(palette); 982 free(palette);
983 } 983 }
984 if (cfg->theme) eina_stringshare_del(cfg->theme); 984 eina_stringshare_del(cfg->theme);
985 if (cfg->modules) eina_stringshare_del(cfg->modules); 985 eina_stringshare_del(cfg->modules);
986 if (cfg->indicator_service_0) eina_stringshare_del(cfg->indicator_service_0); 986 eina_stringshare_del(cfg->indicator_service_0);
987 if (cfg->indicator_service_90) eina_stringshare_del(cfg->indicator_service_90); 987 eina_stringshare_del(cfg->indicator_service_90);
988 if (cfg->indicator_service_180) eina_stringshare_del(cfg->indicator_service_180); 988 eina_stringshare_del(cfg->indicator_service_180);
989 if (cfg->indicator_service_270) eina_stringshare_del(cfg->indicator_service_270); 989 eina_stringshare_del(cfg->indicator_service_270);
990 free(cfg); 990 free(cfg);
991} 991}
992 992
@@ -1436,7 +1436,7 @@ _config_update(void)
1436 } 1436 }
1437 if (s) 1437 if (s)
1438 { 1438 {
1439 if (_elm_config->modules) eina_stringshare_del(_elm_config->modules); 1439 eina_stringshare_del(_elm_config->modules);
1440 _elm_config->modules = s; 1440 _elm_config->modules = s;
1441 } 1441 }
1442 IFCFGEND; 1442 IFCFGEND;
@@ -2685,8 +2685,7 @@ _elm_config_shutdown(void)
2685#undef ENGINE_COMPARE 2685#undef ENGINE_COMPARE
2686 { 2686 {
2687#ifdef HAVE_ELEMENTARY_X 2687#ifdef HAVE_ELEMENTARY_X
2688 ecore_event_handler_del(_prop_change_handler); 2688 ELM_SAFE_FREE(_prop_change_handler, ecore_event_handler_del);
2689 _prop_change_handler = NULL;
2690#endif 2689#endif
2691 } 2690 }
2692 ELM_SAFE_FREE(_elm_config, _config_free); 2691 ELM_SAFE_FREE(_elm_config, _config_free);
diff --git a/src/lib/elm_conform.c b/src/lib/elm_conform.c
index d487db0c9..65bd5f79b 100644
--- a/src/lib/elm_conform.c
+++ b/src/lib/elm_conform.c
@@ -924,7 +924,7 @@ _elm_conformant_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
924 Elm_Conformant_Smart_Data *sd = _pd; 924 Elm_Conformant_Smart_Data *sd = _pd;
925 925
926#ifdef HAVE_ELEMENTARY_X 926#ifdef HAVE_ELEMENTARY_X
927 if (sd->prop_hdl) ecore_event_handler_del(sd->prop_hdl); 927 ecore_event_handler_del(sd->prop_hdl);
928#endif 928#endif
929 929
930 ecore_job_del(sd->show_region_job); 930 ecore_job_del(sd->show_region_job);
diff --git a/src/lib/elm_dbus_menu.c b/src/lib/elm_dbus_menu.c
index 088bb32ec..7c151cc56 100644
--- a/src/lib/elm_dbus_menu.c
+++ b/src/lib/elm_dbus_menu.c
@@ -920,12 +920,10 @@ _elm_dbus_menu_unregister(Eo *obj)
920 _elm_dbus_menu_app_menu_unregister(obj); 920 _elm_dbus_menu_app_menu_unregister(obj);
921 eldbus_service_interface_unregister(sd->dbus_menu->iface); 921 eldbus_service_interface_unregister(sd->dbus_menu->iface);
922 eldbus_connection_unref(sd->dbus_menu->bus); 922 eldbus_connection_unref(sd->dbus_menu->bus);
923 if (sd->dbus_menu->signal_idler) 923 ecore_idler_del(sd->dbus_menu->signal_idler);
924 ecore_idler_del(sd->dbus_menu->signal_idler);
925 924
926 eina_hash_free(sd->dbus_menu->elements); 925 eina_hash_free(sd->dbus_menu->elements);
927 free(sd->dbus_menu); 926 ELM_SAFE_FREE(sd->dbus_menu, free);
928 sd->dbus_menu = NULL;
929} 927}
930 928
931void 929void
diff --git a/src/lib/elm_diskselector.c b/src/lib/elm_diskselector.c
index b25908366..04b41b1d0 100644
--- a/src/lib/elm_diskselector.c
+++ b/src/lib/elm_diskselector.c
@@ -226,11 +226,7 @@ _string_check(void *data)
226 Evas_Object *obj = data; 226 Evas_Object *obj = data;
227 ELM_DISKSELECTOR_DATA_GET(obj, sd); 227 ELM_DISKSELECTOR_DATA_GET(obj, sd);
228 228
229 if (sd->string_check_idle_enterer) 229 ELM_SAFE_FREE(sd->string_check_idle_enterer, ecore_idle_enterer_del);
230 {
231 ecore_idle_enterer_del(sd->string_check_idle_enterer);
232 sd->string_check_idle_enterer = NULL;
233 }
234 230
235 // call string check idle enterer directly 231 // call string check idle enterer directly
236 _string_check_idle_enterer_cb(data); 232 _string_check_idle_enterer_cb(data);
@@ -337,9 +333,7 @@ _item_del(Elm_Diskselector_Item *item)
337 ELM_DISKSELECTOR_DATA_GET(WIDGET(item), sd); 333 ELM_DISKSELECTOR_DATA_GET(WIDGET(item), sd);
338 sd->item_count -= 1; 334 sd->item_count -= 1;
339 eina_stringshare_del(item->label); 335 eina_stringshare_del(item->label);
340 336 evas_object_del(item->icon);
341 if (item->icon)
342 evas_object_del(item->icon);
343} 337}
344 338
345static void 339static void
@@ -492,7 +486,7 @@ _item_icon_set(Elm_Diskselector_Item *it,
492{ 486{
493 if (it->icon == icon) return; 487 if (it->icon == icon) return;
494 488
495 if (it->icon) evas_object_del(it->icon); 489 evas_object_del(it->icon);
496 it->icon = icon; 490 it->icon = icon;
497 491
498 if (VIEW(it)) 492 if (VIEW(it))
@@ -1421,17 +1415,8 @@ _elm_diskselector_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1421 } 1415 }
1422 sd->r_items = eina_list_free(sd->r_items); 1416 sd->r_items = eina_list_free(sd->r_items);
1423 1417
1424 if (sd->scroller_move_idle_enterer) 1418 ELM_SAFE_FREE(sd->scroller_move_idle_enterer, ecore_idle_enterer_del);
1425 { 1419 ELM_SAFE_FREE(sd->string_check_idle_enterer, ecore_idle_enterer_del);
1426 ecore_idle_enterer_del(sd->scroller_move_idle_enterer);
1427 sd->scroller_move_idle_enterer = NULL;
1428 }
1429
1430 if (sd->string_check_idle_enterer)
1431 {
1432 ecore_idle_enterer_del(sd->string_check_idle_enterer);
1433 sd->string_check_idle_enterer = NULL;
1434 }
1435 1420
1436 eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); 1421 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
1437} 1422}
diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c
index 7fa3b135f..c34a31b71 100644
--- a/src/lib/elm_entry.c
+++ b/src/lib/elm_entry.c
@@ -121,8 +121,7 @@ _file_load(const char *file)
121 121
122 if (eina_file_map_faulted(f, tmp)) 122 if (eina_file_map_faulted(f, tmp))
123 { 123 {
124 free(text); 124 ELM_SAFE_FREE(text, free);
125 text = NULL;
126 } 125 }
127 126
128 on_error: 127 on_error:
@@ -347,7 +346,7 @@ _filter_free(Elm_Entry_Markup_Filter *tf)
347 { 346 {
348 Elm_Entry_Filter_Limit_Size *lim = tf->data; 347 Elm_Entry_Filter_Limit_Size *lim = tf->data;
349 348
350 if (lim) free(lim); 349 free(lim);
351 } 350 }
352 else if (tf->func == elm_entry_filter_accept_set) 351 else if (tf->func == elm_entry_filter_accept_set)
353 { 352 {
@@ -355,8 +354,8 @@ _filter_free(Elm_Entry_Markup_Filter *tf)
355 354
356 if (as) 355 if (as)
357 { 356 {
358 if (as->accepted) eina_stringshare_del(as->accepted); 357 eina_stringshare_del(as->accepted);
359 if (as->rejected) eina_stringshare_del(as->rejected); 358 eina_stringshare_del(as->rejected);
360 359
361 free(as); 360 free(as);
362 } 361 }
@@ -1419,9 +1418,9 @@ _magnifier_create(void *data)
1419 Evas *e; 1418 Evas *e;
1420 Evas_Coord w, h, mw, mh; 1419 Evas_Coord w, h, mw, mh;
1421 1420
1422 if (sd->mgf_proxy) evas_object_del(sd->mgf_proxy); 1421 evas_object_del(sd->mgf_proxy);
1423 if (sd->mgf_bg) evas_object_del(sd->mgf_bg); 1422 evas_object_del(sd->mgf_bg);
1424 if (sd->mgf_clip) evas_object_del(sd->mgf_clip); 1423 evas_object_del(sd->mgf_clip);
1425 1424
1426 e = evas_object_evas_get(data); 1425 e = evas_object_evas_get(data);
1427 1426
@@ -1867,8 +1866,7 @@ _entry_selection_cleared_signal_cb(void *data,
1867 (data, ELM_SEL_TYPE_PRIMARY, ELM_SEL_FORMAT_MARKUP, 1866 (data, ELM_SEL_TYPE_PRIMARY, ELM_SEL_FORMAT_MARKUP,
1868 sd->cut_sel, eina_stringshare_strlen(sd->cut_sel)); 1867 sd->cut_sel, eina_stringshare_strlen(sd->cut_sel));
1869 1868
1870 eina_stringshare_del(sd->cut_sel); 1869 ELM_SAFE_FREE(sd->cut_sel, eina_stringshare_del);
1871 sd->cut_sel = NULL;
1872 } 1870 }
1873 else 1871 else
1874 { 1872 {
@@ -2125,8 +2123,7 @@ _entry_hover_anchor_clicked_do(Evas_Object *obj,
2125 !elm_layout_content_get(sd->anchor_hover.hover, "top") && 2123 !elm_layout_content_get(sd->anchor_hover.hover, "top") &&
2126 !elm_layout_content_get(sd->anchor_hover.hover, "bottom")) 2124 !elm_layout_content_get(sd->anchor_hover.hover, "bottom"))
2127 { 2125 {
2128 evas_object_del(sd->anchor_hover.hover); 2126 ELM_SAFE_FREE(sd->anchor_hover.hover, evas_object_del);
2129 sd->anchor_hover.hover = NULL;
2130 } 2127 }
2131 else 2128 else
2132 evas_object_show(sd->anchor_hover.hover); 2129 evas_object_show(sd->anchor_hover.hover);
@@ -2568,19 +2565,16 @@ _chars_add_till_limit(Evas_Object *obj,
2568 unit_size = strlen(utfstr); 2565 unit_size = strlen(utfstr);
2569 else if (unit == LENGTH_UNIT_CHAR) 2566 else if (unit == LENGTH_UNIT_CHAR)
2570 unit_size = evas_string_char_len_get(utfstr); 2567 unit_size = evas_string_char_len_get(utfstr);
2571 free(utfstr); 2568 ELM_SAFE_FREE(utfstr, free);
2572 utfstr = NULL;
2573 } 2569 }
2574 free(markup); 2570 ELM_SAFE_FREE(markup, free);
2575 markup = NULL;
2576 } 2571 }
2577 if (can_add < unit_size) 2572 if (can_add < unit_size)
2578 { 2573 {
2579 if (!i) 2574 if (!i)
2580 { 2575 {
2581 evas_object_smart_callback_call(obj, SIG_MAX_LENGTH, NULL); 2576 evas_object_smart_callback_call(obj, SIG_MAX_LENGTH, NULL);
2582 free(*text); 2577 ELM_SAFE_FREE(*text, free);
2583 *text = NULL;
2584 return; 2578 return;
2585 } 2579 }
2586 can_add = 0; 2580 can_add = 0;
@@ -2752,8 +2746,7 @@ _elm_entry_smart_text_set(Eo *obj, void *_pd, va_list *list)
2752 if (sd->append_text_idler) 2746 if (sd->append_text_idler)
2753 { 2747 {
2754 ecore_idler_del(sd->append_text_idler); 2748 ecore_idler_del(sd->append_text_idler);
2755 free(sd->append_text_left); 2749 ELM_SAFE_FREE(sd->append_text_left, free);
2756 sd->append_text_left = NULL;
2757 sd->append_text_idler = NULL; 2750 sd->append_text_idler = NULL;
2758 } 2751 }
2759 2752
@@ -3412,8 +3405,7 @@ _elm_entry_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
3412 if (sd->append_text_idler) 3405 if (sd->append_text_idler)
3413 { 3406 {
3414 ecore_idler_del(sd->append_text_idler); 3407 ecore_idler_del(sd->append_text_idler);
3415 free(sd->append_text_left); 3408 ELM_SAFE_FREE(sd->append_text_left, free);
3416 sd->append_text_left = NULL;
3417 sd->append_text_idler = NULL; 3409 sd->append_text_idler = NULL;
3418 } 3410 }
3419 ecore_timer_del(sd->longpress_timer); 3411 ecore_timer_del(sd->longpress_timer);
@@ -3433,8 +3425,8 @@ _elm_entry_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
3433 _filter_free(tf); 3425 _filter_free(tf);
3434 } 3426 }
3435 ELM_SAFE_FREE(sd->delay_write, ecore_timer_del); 3427 ELM_SAFE_FREE(sd->delay_write, ecore_timer_del);
3436 if (sd->input_panel_imdata) free(sd->input_panel_imdata); 3428 free(sd->input_panel_imdata);
3437 if (sd->anchor_hover.hover_style) eina_stringshare_del(sd->anchor_hover.hover_style); 3429 eina_stringshare_del(sd->anchor_hover.hover_style);
3438 3430
3439 evas_event_thaw(evas_object_evas_get(obj)); 3431 evas_event_thaw(evas_object_evas_get(obj));
3440 evas_event_thaw_eval(evas_object_evas_get(obj)); 3432 evas_event_thaw_eval(evas_object_evas_get(obj));
@@ -4702,8 +4694,7 @@ elm_entry_filter_limit_size(void *data,
4702 if ((len >= lim->max_char_count) && (newlen > 0)) 4694 if ((len >= lim->max_char_count) && (newlen > 0))
4703 { 4695 {
4704 evas_object_smart_callback_call(entry, SIG_MAX_LENGTH, NULL); 4696 evas_object_smart_callback_call(entry, SIG_MAX_LENGTH, NULL);
4705 free(*text); 4697 ELM_SAFE_FREE(*text, free);
4706 *text = NULL;
4707 free(current); 4698 free(current);
4708 free(utfstr); 4699 free(utfstr);
4709 return; 4700 return;
@@ -4719,8 +4710,7 @@ elm_entry_filter_limit_size(void *data,
4719 if ((len >= lim->max_byte_count) && (newlen > 0)) 4710 if ((len >= lim->max_byte_count) && (newlen > 0))
4720 { 4711 {
4721 evas_object_smart_callback_call(entry, SIG_MAX_LENGTH, NULL); 4712 evas_object_smart_callback_call(entry, SIG_MAX_LENGTH, NULL);
4722 free(*text); 4713 ELM_SAFE_FREE(*text, free);
4723 *text = NULL;
4724 free(current); 4714 free(current);
4725 free(utfstr); 4715 free(utfstr);
4726 return; 4716 return;
@@ -5509,8 +5499,7 @@ _input_panel_imdata_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5509 int len = va_arg(*list, int); 5499 int len = va_arg(*list, int);
5510 Elm_Entry_Smart_Data *sd = _pd; 5500 Elm_Entry_Smart_Data *sd = _pd;
5511 5501
5512 if (sd->input_panel_imdata) 5502 free(sd->input_panel_imdata);
5513 free(sd->input_panel_imdata);
5514 5503
5515 sd->input_panel_imdata = calloc(1, len); 5504 sd->input_panel_imdata = calloc(1, len);
5516 sd->input_panel_imdata_len = len; 5505 sd->input_panel_imdata_len = len;
diff --git a/src/lib/elm_factory.c b/src/lib/elm_factory.c
index bb25f627e..212f5121b 100644
--- a/src/lib/elm_factory.c
+++ b/src/lib/elm_factory.c
@@ -253,7 +253,7 @@ _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content)
253 if (wd->content == content) return; 253 if (wd->content == content) return;
254 254
255 prev_content = _content_unset_hook(obj, part); 255 prev_content = _content_unset_hook(obj, part);
256 if (prev_content) evas_object_del(prev_content); 256 evas_object_del(prev_content);
257 257
258 wd->content = content; 258 wd->content = content;
259 if (!content) return; 259 if (!content) return;
diff --git a/src/lib/elm_flip.c b/src/lib/elm_flip.c
index f1087374c..f8556c844 100644
--- a/src/lib/elm_flip.c
+++ b/src/lib/elm_flip.c
@@ -679,8 +679,7 @@ _state_update(Evas_Object *obj)
679 sd->slices2 = calloc(sd->slices_w * sd->slices_h, sizeof(Slice *)); 679 sd->slices2 = calloc(sd->slices_w * sd->slices_h, sizeof(Slice *));
680 if (!sd->slices2) 680 if (!sd->slices2)
681 { 681 {
682 free(sd->slices); 682 ELM_SAFE_FREE(sd->slices, free);
683 sd->slices = NULL;
684 return 0; 683 return 0;
685 } 684 }
686 } 685 }
@@ -1749,7 +1748,7 @@ _flip_content_set(Evas_Object *obj,
1749 1748
1750 if (*cont == content) return EINA_TRUE; 1749 if (*cont == content) return EINA_TRUE;
1751 1750
1752 if (*cont) evas_object_del(*cont); 1751 evas_object_del(*cont);
1753 *cont = content; 1752 *cont = content;
1754 1753
1755 if (content) 1754 if (content)
diff --git a/src/lib/elm_font.c b/src/lib/elm_font.c
index 571f1836a..d95c8157f 100644
--- a/src/lib/elm_font.c
+++ b/src/lib/elm_font.c
@@ -108,9 +108,9 @@ _elm_font_properties_free(Elm_Font_Properties *efp)
108 const char *str; 108 const char *str;
109 109
110 EINA_LIST_FREE(efp->styles, str) 110 EINA_LIST_FREE(efp->styles, str)
111 if (str) eina_stringshare_del(str); 111 eina_stringshare_del(str);
112 112
113 if (efp->name) eina_stringshare_del(efp->name); 113 eina_stringshare_del(efp->name);
114 free(efp); 114 free(efp);
115} 115}
116 116
@@ -147,8 +147,8 @@ elm_font_properties_free(Elm_Font_Properties *efp)
147 147
148 EINA_SAFETY_ON_NULL_RETURN(efp); 148 EINA_SAFETY_ON_NULL_RETURN(efp);
149 EINA_LIST_FREE(efp->styles, str) 149 EINA_LIST_FREE(efp->styles, str)
150 if (str) eina_stringshare_del(str); 150 eina_stringshare_del(str);
151 if (efp->name) eina_stringshare_del(efp->name); 151 eina_stringshare_del(efp->name);
152 free(efp); 152 free(efp);
153} 153}
154 154
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index 6665c9741..4040810cd 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -2262,7 +2262,7 @@ _elm_gengrid_clear(Evas_Object *obj,
2262 sd->clear_me = EINA_FALSE; 2262 sd->clear_me = EINA_FALSE;
2263 sd->pan_changed = EINA_TRUE; 2263 sd->pan_changed = EINA_TRUE;
2264 ELM_SAFE_FREE(sd->calc_job, ecore_job_del); 2264 ELM_SAFE_FREE(sd->calc_job, ecore_job_del);
2265 if (sd->selected) sd->selected = eina_list_free(sd->selected); 2265 sd->selected = eina_list_free(sd->selected);
2266 if (sd->clear_cb) sd->clear_cb(sd); 2266 if (sd->clear_cb) sd->clear_cb(sd);
2267 sd->pan_x = 0; 2267 sd->pan_x = 0;
2268 sd->pan_y = 0; 2268 sd->pan_y = 0;
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 8b7cf6ada..72b676560 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -793,7 +793,7 @@ _item_tree_effect_finish(Elm_Genlist_Smart_Data *sd)
793 evas_object_lower(sd->alpha_bg); 793 evas_object_lower(sd->alpha_bg);
794 evas_object_hide(sd->alpha_bg); 794 evas_object_hide(sd->alpha_bg);
795 sd->move_effect_mode = ELM_GENLIST_TREE_EFFECT_NONE; 795 sd->move_effect_mode = ELM_GENLIST_TREE_EFFECT_NONE;
796 if (sd->move_items) sd->move_items = eina_list_free(sd->move_items); 796 sd->move_items = eina_list_free(sd->move_items);
797 797
798 evas_object_smart_callback_call(sd->pan_obj, "changed", NULL); 798 evas_object_smart_callback_call(sd->pan_obj, "changed", NULL);
799 evas_object_smart_callback_call 799 evas_object_smart_callback_call
@@ -1252,8 +1252,8 @@ _item_cache_clean(Elm_Genlist_Smart_Data *sd)
1252 sd->item_cache = eina_inlist_remove 1252 sd->item_cache = eina_inlist_remove
1253 (sd->item_cache, sd->item_cache->last); 1253 (sd->item_cache, sd->item_cache->last);
1254 sd->item_cache_count--; 1254 sd->item_cache_count--;
1255 if (itc->spacer) evas_object_del(itc->spacer); 1255 evas_object_del(itc->spacer);
1256 if (itc->base_view) evas_object_del(itc->base_view); 1256 evas_object_del(itc->base_view);
1257 eina_stringshare_del(itc->item_style); 1257 eina_stringshare_del(itc->item_style);
1258 free(itc); 1258 free(itc);
1259 } 1259 }
@@ -1265,8 +1265,8 @@ _item_cache_clean(Elm_Genlist_Smart_Data *sd)
1265static void 1265static void
1266_item_cache_free(Item_Cache *itc) 1266_item_cache_free(Item_Cache *itc)
1267{ 1267{
1268 if (itc->spacer) evas_object_del(itc->spacer); 1268 evas_object_del(itc->spacer);
1269 if (itc->base_view) evas_object_del(itc->base_view); 1269 evas_object_del(itc->base_view);
1270 eina_stringshare_del(itc->item_style); 1270 eina_stringshare_del(itc->item_style);
1271 free(itc); 1271 free(itc);
1272} 1272}
@@ -1293,8 +1293,7 @@ _item_cache_add(Elm_Gen_Item *it)
1293 evas_event_freeze(evas_object_evas_get(obj)); 1293 evas_event_freeze(evas_object_evas_get(obj));
1294 if (sd->item_cache_max <= 0) 1294 if (sd->item_cache_max <= 0)
1295 { 1295 {
1296 evas_object_del(VIEW(it)); 1296 ELM_SAFE_FREE(VIEW(it), evas_object_del);
1297 VIEW(it) = NULL;
1298 ELM_SAFE_FREE(it->spacer, evas_object_del); 1297 ELM_SAFE_FREE(it->spacer, evas_object_del);
1299 1298
1300 evas_event_thaw(evas_object_evas_get(obj)); 1299 evas_event_thaw(evas_object_evas_get(obj));
@@ -4012,7 +4011,7 @@ _item_idle_enterer(void *data)
4012static void 4011static void
4013_requeue_idle_enterer(Elm_Genlist_Smart_Data *sd) 4012_requeue_idle_enterer(Elm_Genlist_Smart_Data *sd)
4014{ 4013{
4015 if (sd->queue_idle_enterer) ecore_idle_enterer_del(sd->queue_idle_enterer); 4014 ecore_idle_enterer_del(sd->queue_idle_enterer);
4016 sd->queue_idle_enterer = ecore_idle_enterer_add(_item_idle_enterer, sd->obj); 4015 sd->queue_idle_enterer = ecore_idle_enterer_add(_item_idle_enterer, sd->obj);
4017} 4016}
4018 4017
@@ -4472,8 +4471,7 @@ _item_unrealize_cb(Elm_Gen_Item *it)
4472 4471
4473 if (it->item->nocache_once || it->item->nocache) 4472 if (it->item->nocache_once || it->item->nocache)
4474 { 4473 {
4475 evas_object_del(VIEW(it)); 4474 ELM_SAFE_FREE(VIEW(it), evas_object_del);
4476 VIEW(it) = NULL;
4477 ELM_SAFE_FREE(it->spacer, evas_object_del); 4475 ELM_SAFE_FREE(it->spacer, evas_object_del);
4478 } 4476 }
4479 else 4477 else
@@ -4988,10 +4986,7 @@ _elm_genlist_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
4988 sd->queue = eina_list_free(sd->queue); 4986 sd->queue = eina_list_free(sd->queue);
4989 elm_genlist_clear(obj); 4987 elm_genlist_clear(obj);
4990 for (i = 0; i < 2; i++) 4988 for (i = 0; i < 2; i++)
4991 { 4989 ELM_SAFE_FREE(sd->stack[i], evas_object_del);
4992 evas_object_del(sd->stack[i]);
4993 sd->stack[i] = NULL;
4994 }
4995 eo_unref(sd->pan_obj); 4990 eo_unref(sd->pan_obj);
4996 ELM_SAFE_FREE(sd->pan_obj, evas_object_del); 4991 ELM_SAFE_FREE(sd->pan_obj, evas_object_del);
4997 4992
@@ -6513,8 +6508,7 @@ elm_genlist_item_fields_update(Elm_Object_Item *item,
6513 { 6508 {
6514 Evas_Object* eobj; 6509 Evas_Object* eobj;
6515 Eina_List* l; 6510 Eina_List* l;
6516 eina_list_free(it->item_focus_chain); 6511 it->item_focus_chain = eina_list_free(it->item_focus_chain);
6517 it->item_focus_chain = NULL;
6518 EINA_LIST_FOREACH(it->content_objs, l, eobj) 6512 EINA_LIST_FOREACH(it->content_objs, l, eobj)
6519 if (elm_object_focus_allow_get(eobj)) 6513 if (elm_object_focus_allow_get(eobj))
6520 it->item_focus_chain = eina_list_append(it->item_focus_chain, eobj); 6514 it->item_focus_chain = eina_list_append(it->item_focus_chain, eobj);
diff --git a/src/lib/elm_glview.c b/src/lib/elm_glview.c
index 766fa44a6..8dccb8540 100644
--- a/src/lib/elm_glview.c
+++ b/src/lib/elm_glview.c
@@ -171,12 +171,8 @@ _set_render_policy_callback(Evas_Object *obj)
171 switch (sd->render_policy) 171 switch (sd->render_policy)
172 { 172 {
173 case ELM_GLVIEW_RENDER_POLICY_ON_DEMAND: 173 case ELM_GLVIEW_RENDER_POLICY_ON_DEMAND:
174 // Delete idle_enterer if it for some reason is around 174 // Delete idle_enterer if it for some reason is around
175 if (sd->render_idle_enterer) 175 ELM_SAFE_FREE(sd->render_idle_enterer, ecore_idle_enterer_del);
176 {
177 ecore_idle_enterer_del(sd->render_idle_enterer);
178 sd->render_idle_enterer = NULL;
179 }
180 176
181 // Set pixel getter callback 177 // Set pixel getter callback
182 evas_object_image_pixels_get_callback_set 178 evas_object_image_pixels_get_callback_set
@@ -267,8 +263,7 @@ _elm_glview_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
267 sd->del_func(obj); 263 sd->del_func(obj);
268 } 264 }
269 265
270 if (sd->render_idle_enterer) 266 ecore_idle_enterer_del(sd->render_idle_enterer);
271 ecore_idle_enterer_del(sd->render_idle_enterer);
272 267
273 if (sd->surface) evas_gl_surface_destroy(sd->evasgl, sd->surface); 268 if (sd->surface) evas_gl_surface_destroy(sd->evasgl, sd->surface);
274 if (sd->context) evas_gl_context_destroy(sd->evasgl, sd->context); 269 if (sd->context) evas_gl_context_destroy(sd->evasgl, sd->context);
diff --git a/src/lib/elm_hover.c b/src/lib/elm_hover.c
index 48a95a176..ca41279da 100644
--- a/src/lib/elm_hover.c
+++ b/src/lib/elm_hover.c
@@ -398,13 +398,7 @@ static void
398_elm_hover_subs_del(Elm_Hover_Smart_Data *sd) 398_elm_hover_subs_del(Elm_Hover_Smart_Data *sd)
399{ 399{
400 ELM_HOVER_PARTS_FOREACH 400 ELM_HOVER_PARTS_FOREACH
401 { 401 ELM_SAFE_FREE(sd->subs[i].obj, evas_object_del);
402 if (sd->subs[i].obj)
403 {
404 evas_object_del(sd->subs[i].obj);
405 sd->subs[i].obj = NULL;
406 }
407 }
408} 402}
409 403
410static void 404static void
diff --git a/src/lib/elm_icon.c b/src/lib/elm_icon.c
index 3f6929eb3..53663c561 100644
--- a/src/lib/elm_icon.c
+++ b/src/lib/elm_icon.c
@@ -381,14 +381,12 @@ _elm_icon_smart_file_set(Eo *obj, void *_pd, va_list *list)
381 381
382 /* parent's edje file setting path replicated here (we got .eet 382 /* parent's edje file setting path replicated here (we got .eet
383 * extension, so bypassing it) */ 383 * extension, so bypassing it) */
384 if (id->prev_img) 384 ELM_SAFE_FREE(id->prev_img, evas_object_del);
385 evas_object_del(id->prev_img);
386 id->prev_img = NULL;
387 385
388 if (!id->edje) 386 if (!id->edje)
389 { 387 {
390 pclip = evas_object_clip_get(id->img); 388 pclip = evas_object_clip_get(id->img);
391 if (id->img) evas_object_del(id->img); 389 evas_object_del(id->img);
392 390
393 /* Edje object instead */ 391 /* Edje object instead */
394 id->img = edje_object_add(evas_object_evas_get(obj)); 392 id->img = edje_object_add(evas_object_evas_get(obj));
@@ -591,7 +589,7 @@ _elm_icon_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
591{ 589{
592 Elm_Icon_Smart_Data *sd = _pd; 590 Elm_Icon_Smart_Data *sd = _pd;
593 591
594 if (sd->stdicon) eina_stringshare_del(sd->stdicon); 592 eina_stringshare_del(sd->stdicon);
595 593
596 if (sd->thumb.request) 594 if (sd->thumb.request)
597 { 595 {
@@ -603,9 +601,7 @@ _elm_icon_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
603 eina_stringshare_del(sd->thumb.file.key); 601 eina_stringshare_del(sd->thumb.file.key);
604 eina_stringshare_del(sd->thumb.thumb.path); 602 eina_stringshare_del(sd->thumb.thumb.path);
605 eina_stringshare_del(sd->thumb.thumb.key); 603 eina_stringshare_del(sd->thumb.thumb.key);
606 604 ecore_event_handler_del(sd->thumb.eeh);
607 if (sd->thumb.eeh)
608 ecore_event_handler_del(sd->thumb.eeh);
609 605
610 _edje_signals_free(sd); 606 _edje_signals_free(sd);
611 607
diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c
index e4e59d1e5..7db194758 100644
--- a/src/lib/elm_image.c
+++ b/src/lib/elm_image.c
@@ -204,7 +204,7 @@ _elm_image_edje_file_set(Evas_Object *obj,
204 if (!sd->edje) 204 if (!sd->edje)
205 { 205 {
206 pclip = evas_object_clip_get(sd->img); 206 pclip = evas_object_clip_get(sd->img);
207 if (sd->img) evas_object_del(sd->img); 207 evas_object_del(sd->img);
208 208
209 /* Edje object instead */ 209 /* Edje object instead */
210 sd->img = edje_object_add(evas_object_evas_get(obj)); 210 sd->img = edje_object_add(evas_object_evas_get(obj));
@@ -919,7 +919,7 @@ _elm_image_smart_download_done(void *data, Elm_Url *url EINA_UNUSED, Eina_Binbuf
919 size_t length; 919 size_t length;
920 Eina_Bool ret = EINA_FALSE; 920 Eina_Bool ret = EINA_FALSE;
921 921
922 if (sd->remote_data) free(sd->remote_data); 922 free(sd->remote_data);
923 length = eina_binbuf_length_get(download); 923 length = eina_binbuf_length_get(download);
924 sd->remote_data = eina_binbuf_string_steal(download); 924 sd->remote_data = eina_binbuf_string_steal(download);
925 f = eina_file_virtualize(_elm_url_get(url), 925 f = eina_file_virtualize(_elm_url_get(url),
@@ -948,8 +948,7 @@ _elm_image_smart_download_done(void *data, Elm_Url *url EINA_UNUSED, Eina_Binbuf
948 } 948 }
949 949
950 sd->remote = NULL; 950 sd->remote = NULL;
951 eina_stringshare_del(sd->key); 951 ELM_SAFE_FREE(sd->key, eina_stringshare_del);
952 sd->key = NULL;
953} 952}
954 953
955static void 954static void
@@ -962,8 +961,7 @@ _elm_image_smart_download_cancel(void *data, Elm_Url *url EINA_UNUSED, int error
962 evas_object_smart_callback_call(obj, SIG_DOWNLOAD_ERROR, &err); 961 evas_object_smart_callback_call(obj, SIG_DOWNLOAD_ERROR, &err);
963 962
964 sd->remote = NULL; 963 sd->remote = NULL;
965 eina_stringshare_del(sd->key); 964 ELM_SAFE_FREE(sd->key, eina_stringshare_del);
966 sd->key = NULL;
967} 965}
968 966
969static void 967static void
@@ -1411,7 +1409,7 @@ _elm_image_smart_orient_set(Eo *obj, void *_pd, va_list *list)
1411 default: 1409 default:
1412 ERR("unknown orient %d", orient); 1410 ERR("unknown orient %d", orient);
1413 evas_object_image_data_set(sd->img, data); // give it back 1411 evas_object_image_data_set(sd->img, data); // give it back
1414 if (data2) free(data2); 1412 free(data2);
1415 1413
1416 return; 1414 return;
1417 } 1415 }
@@ -1427,7 +1425,7 @@ _elm_image_smart_orient_set(Eo *obj, void *_pd, va_list *list)
1427 } 1425 }
1428 to += hw; 1426 to += hw;
1429 } 1427 }
1430 if (data2) free(data2); 1428 free(data2);
1431 1429
1432 evas_object_image_data_set(sd->img, data); 1430 evas_object_image_data_set(sd->img, data);
1433 evas_object_image_data_update_add(sd->img, 0, 0, iw, ih); 1431 evas_object_image_data_update_add(sd->img, 0, 0, iw, ih);
diff --git a/src/lib/elm_index.c b/src/lib/elm_index.c
index eaaa51030..5b9597eb4 100644
--- a/src/lib/elm_index.c
+++ b/src/lib/elm_index.c
@@ -81,11 +81,8 @@ _index_box_clear(Evas_Object *obj,
81 81
82 EINA_LIST_FOREACH(sd->items, l, it) 82 EINA_LIST_FOREACH(sd->items, l, it)
83 { 83 {
84 if (!VIEW(it)) continue;
85 if (it->level != level) continue; 84 if (it->level != level) continue;
86 85 ELM_SAFE_FREE(VIEW(it), evas_object_del);
87 evas_object_del(VIEW(it));
88 VIEW(it) = NULL;
89 } 86 }
90 87
91 sd->level_active[level] = EINA_FALSE; 88 sd->level_active[level] = EINA_FALSE;
@@ -362,11 +359,9 @@ _elm_index_smart_theme(Eo *obj, void *_pd, va_list *list)
362 } 359 }
363 elm_layout_content_set(obj, "elm.swallow.index.1", sd->bx[1]); 360 elm_layout_content_set(obj, "elm.swallow.index.1", sd->bx[1]);
364 } 361 }
365 else if (sd->bx[1]) 362 else
366 { 363 ELM_SAFE_FREE(sd->bx[1], evas_object_del);
367 evas_object_del(sd->bx[1]); 364
368 sd->bx[1] = NULL;
369 }
370 if (edje_object_part_exists 365 if (edje_object_part_exists
371 (wd->resize_obj, "elm.swallow.event.1")) 366 (wd->resize_obj, "elm.swallow.event.1"))
372 { 367 {
@@ -380,11 +375,9 @@ _elm_index_smart_theme(Eo *obj, void *_pd, va_list *list)
380 elm_layout_content_set(obj, "elm.swallow.event.1", sd->event_rect[1]); 375 elm_layout_content_set(obj, "elm.swallow.event.1", sd->event_rect[1]);
381 evas_object_size_hint_min_set(sd->event_rect[1], minw, minh); 376 evas_object_size_hint_min_set(sd->event_rect[1], minw, minh);
382 } 377 }
383 else if (sd->event_rect[1]) 378 else
384 { 379 ELM_SAFE_FREE(sd->event_rect[1], evas_object_del);
385 evas_object_del(sd->event_rect[1]); 380
386 sd->event_rect[1] = NULL;
387 }
388 edje_object_message_signal_process(wd->resize_obj); 381 edje_object_message_signal_process(wd->resize_obj);
389 382
390 elm_layout_sizing_eval(obj); 383 elm_layout_sizing_eval(obj);
diff --git a/src/lib/elm_interface_scrollable.c b/src/lib/elm_interface_scrollable.c
index 046ad63d3..1ba09803a 100644
--- a/src/lib/elm_interface_scrollable.c
+++ b/src/lib/elm_interface_scrollable.c
@@ -1461,10 +1461,7 @@ _elm_scroll_bounce_eval(Elm_Scrollable_Smart_Interface_Data *sid)
1461 if (sid->content_info.resized) 1461 if (sid->content_info.resized)
1462 _elm_scroll_wanted_region_set(sid->obj); 1462 _elm_scroll_wanted_region_set(sid->obj);
1463 } 1463 }
1464 if (sid->down.hold_enterer) 1464 ELM_SAFE_FREE(sid->down.hold_enterer, ecore_idle_enterer_del);
1465 {
1466 ELM_SAFE_FREE(sid->down.hold_enterer, ecore_idle_enterer_del);
1467 }
1468 1465
1469 eo_do(sid->pan_obj, elm_obj_pan_pos_max_get(&mx, &my)); 1466 eo_do(sid->pan_obj, elm_obj_pan_pos_max_get(&mx, &my));
1470 eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny)); 1467 eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
@@ -1790,10 +1787,7 @@ _elm_scroll_content_region_show_internal(Evas_Object *obj,
1790 if (sid->content_info.resized) 1787 if (sid->content_info.resized)
1791 _elm_scroll_wanted_region_set(sid->obj); 1788 _elm_scroll_wanted_region_set(sid->obj);
1792 } 1789 }
1793 if (sid->down.hold_enterer) 1790 ELM_SAFE_FREE(sid->down.hold_enterer, ecore_idle_enterer_del);
1794 {
1795 ELM_SAFE_FREE(sid->down.hold_enterer, ecore_idle_enterer_del);
1796 }
1797 if (sid->down.momentum_animator) 1791 if (sid->down.momentum_animator)
1798 { 1792 {
1799 ELM_SAFE_FREE(sid->down.momentum_animator, ecore_animator_del); 1793 ELM_SAFE_FREE(sid->down.momentum_animator, ecore_animator_del);
@@ -2639,10 +2633,7 @@ _elm_scroll_mouse_up_event_cb(void *data,
2639 if (sid->content_info.resized) 2633 if (sid->content_info.resized)
2640 _elm_scroll_wanted_region_set(sid->obj); 2634 _elm_scroll_wanted_region_set(sid->obj);
2641 } 2635 }
2642 if (sid->down.hold_enterer) 2636 ELM_SAFE_FREE(sid->down.hold_enterer, ecore_idle_enterer_del);
2643 {
2644 ELM_SAFE_FREE(sid->down.hold_enterer, ecore_idle_enterer_del);
2645 }
2646 if (sid->down.scroll) 2637 if (sid->down.scroll)
2647 { 2638 {
2648 ev->event_flags |= EVAS_EVENT_FLAG_ON_SCROLL; 2639 ev->event_flags |= EVAS_EVENT_FLAG_ON_SCROLL;
@@ -2729,10 +2720,7 @@ _elm_scroll_mouse_down_event_cb(void *data,
2729 if (sid->content_info.resized) 2720 if (sid->content_info.resized)
2730 _elm_scroll_wanted_region_set(sid->obj); 2721 _elm_scroll_wanted_region_set(sid->obj);
2731 } 2722 }
2732 if (sid->down.hold_enterer) 2723 ELM_SAFE_FREE(sid->down.hold_enterer, ecore_idle_enterer_del);
2733 {
2734 ELM_SAFE_FREE(sid->down.hold_enterer, ecore_idle_enterer_del);
2735 }
2736 if (sid->down.momentum_animator) 2724 if (sid->down.momentum_animator)
2737 { 2725 {
2738 ELM_SAFE_FREE(sid->down.momentum_animator, ecore_animator_del); 2726 ELM_SAFE_FREE(sid->down.momentum_animator, ecore_animator_del);
@@ -3047,7 +3035,7 @@ _elm_scroll_hold_animator(void *data)
3047{ 3035{
3048 Elm_Scrollable_Smart_Interface_Data *sid = data; 3036 Elm_Scrollable_Smart_Interface_Data *sid = data;
3049 3037
3050 if (sid->down.hold_enterer) ecore_idle_enterer_del(sid->down.hold_enterer); 3038 ecore_idle_enterer_del(sid->down.hold_enterer);
3051 sid->down.hold_enterer = 3039 sid->down.hold_enterer =
3052 ecore_idle_enterer_before_add(_elm_scroll_hold_enterer, sid); 3040 ecore_idle_enterer_before_add(_elm_scroll_hold_enterer, sid);
3053 return ECORE_CALLBACK_RENEW; 3041 return ECORE_CALLBACK_RENEW;
@@ -3857,11 +3845,7 @@ _elm_scroll_extern_pan_set(Eo *obj, void *_pd, va_list *list)
3857 } 3845 }
3858 else 3846 else
3859 { 3847 {
3860 if (sid->pan_obj) 3848 ELM_SAFE_FREE(sid->pan_obj, evas_object_del);
3861 {
3862 evas_object_del(sid->pan_obj);
3863 sid->pan_obj = NULL;
3864 }
3865 } 3849 }
3866 if (!pan) 3850 if (!pan)
3867 { 3851 {
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index 8ca8825c3..13fd48075 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -1396,11 +1396,7 @@ _item_content_set_hook(Elm_Object_Item *it,
1396 evas_object_rectangle_add(evas_object_evas_get(WIDGET(item))); 1396 evas_object_rectangle_add(evas_object_evas_get(WIDGET(item)));
1397 evas_object_color_set(content, 0, 0, 0, 0); 1397 evas_object_color_set(content, 0, 0, 0, 0);
1398 } 1398 }
1399 if (*icon_p) 1399 evas_object_del(*icon_p);
1400 {
1401 evas_object_del(*icon_p);
1402 *icon_p = NULL;
1403 }
1404 *icon_p = content; 1400 *icon_p = content;
1405 1401
1406 if (VIEW(item)) 1402 if (VIEW(item))
diff --git a/src/lib/elm_main.c b/src/lib/elm_main.c
index d9959cf85..883bdc469 100644
--- a/src/lib/elm_main.c
+++ b/src/lib/elm_main.c
@@ -174,19 +174,13 @@ static void
174_prefix_shutdown(void) 174_prefix_shutdown(void)
175{ 175{
176 if (app_pfx) eina_prefix_free(app_pfx); 176 if (app_pfx) eina_prefix_free(app_pfx);
177 if (app_domain) eina_stringshare_del(app_domain); 177 ELM_SAFE_FREE(app_domain, eina_stringshare_del);
178 if (app_checkfile) eina_stringshare_del(app_checkfile); 178 ELM_SAFE_FREE(app_checkfile, eina_stringshare_del);
179 if (app_compile_bin_dir) eina_stringshare_del(app_compile_bin_dir); 179 ELM_SAFE_FREE(app_compile_bin_dir, eina_stringshare_del);
180 if (app_compile_lib_dir) eina_stringshare_del(app_compile_lib_dir); 180 ELM_SAFE_FREE(app_compile_lib_dir, eina_stringshare_del);
181 if (app_compile_data_dir) eina_stringshare_del(app_compile_data_dir); 181 ELM_SAFE_FREE(app_compile_data_dir, eina_stringshare_del);
182 if (app_compile_locale_dir) eina_stringshare_del(app_compile_locale_dir); 182 ELM_SAFE_FREE(app_compile_locale_dir, eina_stringshare_del);
183 app_mainfunc = NULL; 183 app_mainfunc = NULL;
184 app_domain = NULL;
185 app_checkfile = NULL;
186 app_compile_bin_dir = NULL;
187 app_compile_lib_dir = NULL;
188 app_compile_data_dir = NULL;
189 app_compile_locale_dir = NULL;
190 app_prefix_dir = NULL; 184 app_prefix_dir = NULL;
191 app_bin_dir = NULL; 185 app_bin_dir = NULL;
192 app_lib_dir = NULL; 186 app_lib_dir = NULL;
@@ -332,10 +326,8 @@ elm_shutdown(void)
332 _elm_init_count--; 326 _elm_init_count--;
333 if (_elm_init_count > 0) return _elm_init_count; 327 if (_elm_init_count > 0) return _elm_init_count;
334 328
335 if (system_handlers[0]) 329 ecore_event_handler_del(system_handlers[0]);
336 ecore_event_handler_del(system_handlers[0]); 330 ecore_event_handler_del(system_handlers[1]);
337 if (system_handlers[1])
338 ecore_event_handler_del(system_handlers[1]);
339 331
340 _elm_win_shutdown(); 332 _elm_win_shutdown();
341 while (_elm_win_deferred_free) ecore_main_loop_iterate(); 333 while (_elm_win_deferred_free) ecore_main_loop_iterate();
@@ -844,10 +836,7 @@ elm_quicklaunch_prepare(int argc,
844 strcat(p, exename); 836 strcat(p, exename);
845 strcat(p, LIBEXT); 837 strcat(p, LIBEXT);
846 if (access(exe2, R_OK | X_OK) != 0) 838 if (access(exe2, R_OK | X_OK) != 0)
847 { 839 ELM_SAFE_FREE(exe2, free);
848 free(exe2);
849 exe2 = NULL;
850 }
851 840
852 /* Try linking to executable first. Works with PIE files. */ 841 /* Try linking to executable first. Works with PIE files. */
853 qr_handle = dlopen(exe, RTLD_NOW | RTLD_GLOBAL); 842 qr_handle = dlopen(exe, RTLD_NOW | RTLD_GLOBAL);
@@ -952,8 +941,7 @@ elm_quicklaunch_fork(int argc,
952 941
953 if (quicklaunch_on) 942 if (quicklaunch_on)
954 { 943 {
955 if (_elm_appname) free(_elm_appname); 944 ELM_SAFE_FREE(_elm_appname, free);
956 _elm_appname = NULL;
957 if ((argv) && (argv[0])) 945 if ((argv) && (argv[0]))
958 _elm_appname = strdup(ecore_file_file_get(argv[0])); 946 _elm_appname = strdup(ecore_file_file_get(argv[0]));
959 947
diff --git a/src/lib/elm_map.c b/src/lib/elm_map.c
index 4064f0a3a..eb579d120 100644
--- a/src/lib/elm_map.c
+++ b/src/lib/elm_map.c
@@ -216,7 +216,7 @@ _nominatim_url_cb(const Evas_Object *obj,
216 216
217 if (str) 217 if (str)
218 { 218 {
219 if (str[0]) free(str[0]); 219 free(str[0]);
220 free(str); 220 free(str);
221 } 221 }
222 } 222 }
@@ -709,7 +709,7 @@ _grid_item_create(Grid *g,
709 } 709 }
710 else eina_stringshare_replace(&gi->url, url); 710 else eina_stringshare_replace(&gi->url, url);
711 711
712 if (url) free(url); 712 free(url);
713 eina_matrixsparse_data_idx_set(g->grid, y, x, gi); 713 eina_matrixsparse_data_idx_set(g->grid, y, x, gi);
714 714
715 return gi; 715 return gi;
@@ -723,10 +723,10 @@ _grid_item_free(Grid_Item *gi)
723 _grid_item_unload(gi); 723 _grid_item_unload(gi);
724 if (gi->g && gi->g->grid) 724 if (gi->g && gi->g->grid)
725 eina_matrixsparse_data_idx_set(gi->g->grid, gi->y, gi->x, NULL); 725 eina_matrixsparse_data_idx_set(gi->g->grid, gi->y, gi->x, NULL);
726 if (gi->url) eina_stringshare_del(gi->url); 726 eina_stringshare_del(gi->url);
727 if (gi->file_have) ecore_file_remove(gi->file); 727 if (gi->file_have) ecore_file_remove(gi->file);
728 if (gi->file) eina_stringshare_del(gi->file); 728 eina_stringshare_del(gi->file);
729 if (gi->img) evas_object_del(gi->img); 729 evas_object_del(gi->img);
730 730
731 free(gi); 731 free(gi);
732} 732}
@@ -1505,7 +1505,7 @@ _overlay_default_content_update(Overlay_Default *ovl,
1505 EINA_SAFETY_ON_NULL_RETURN(ovl); 1505 EINA_SAFETY_ON_NULL_RETURN(ovl);
1506 1506
1507 if (ovl->content == content) return; 1507 if (ovl->content == content) return;
1508 if (ovl->content) evas_object_del(ovl->content); 1508 evas_object_del(ovl->content);
1509 ovl->content = content; 1509 ovl->content = content;
1510 1510
1511 if (ovl->content) 1511 if (ovl->content)
@@ -1555,7 +1555,7 @@ _overlay_default_class_content_update(Overlay_Default *ovl,
1555{ 1555{
1556 EINA_SAFETY_ON_NULL_RETURN(ovl); 1556 EINA_SAFETY_ON_NULL_RETURN(ovl);
1557 1557
1558 if (ovl->clas_content) evas_object_del(ovl->clas_content); 1558 evas_object_del(ovl->clas_content);
1559 ovl->clas_content = _icon_dup(content, ovl->layout); 1559 ovl->clas_content = _icon_dup(content, ovl->layout);
1560 _overlay_default_layout_update(ovl); 1560 _overlay_default_layout_update(ovl);
1561} 1561}
@@ -1568,7 +1568,7 @@ _overlay_default_icon_update(Overlay_Default *ovl,
1568 1568
1569 if (ovl->icon == icon) return; 1569 if (ovl->icon == icon) return;
1570 1570
1571 if (ovl->icon) evas_object_del(ovl->icon); 1571 evas_object_del(ovl->icon);
1572 ovl->icon = icon; 1572 ovl->icon = icon;
1573 _overlay_default_layout_update(ovl); 1573 _overlay_default_layout_update(ovl);
1574} 1574}
@@ -1579,7 +1579,7 @@ _overlay_default_class_icon_update(Overlay_Default *ovl,
1579{ 1579{
1580 EINA_SAFETY_ON_NULL_RETURN(ovl); 1580 EINA_SAFETY_ON_NULL_RETURN(ovl);
1581 1581
1582 if (ovl->clas_icon) evas_object_del(ovl->clas_icon); 1582 evas_object_del(ovl->clas_icon);
1583 ovl->clas_icon = _icon_dup(icon, ovl->layout); 1583 ovl->clas_icon = _icon_dup(icon, ovl->layout);
1584 _overlay_default_layout_update(ovl); 1584 _overlay_default_layout_update(ovl);
1585} 1585}
@@ -1599,11 +1599,11 @@ _overlay_default_free(Overlay_Default *ovl)
1599{ 1599{
1600 EINA_SAFETY_ON_NULL_RETURN(ovl); 1600 EINA_SAFETY_ON_NULL_RETURN(ovl);
1601 1601
1602 if (ovl->content) evas_object_del(ovl->content); 1602 evas_object_del(ovl->content);
1603 if (ovl->icon) evas_object_del(ovl->icon); 1603 evas_object_del(ovl->icon);
1604 if (ovl->clas_content) evas_object_del(ovl->clas_content); 1604 evas_object_del(ovl->clas_content);
1605 if (ovl->clas_icon) evas_object_del(ovl->clas_icon); 1605 evas_object_del(ovl->clas_icon);
1606 if (ovl->layout) evas_object_del(ovl->layout); 1606 evas_object_del(ovl->layout);
1607 1607
1608 free(ovl); 1608 free(ovl);
1609} 1609}
@@ -1672,7 +1672,7 @@ _overlay_group_coord_member_update(Overlay_Group *grp,
1672 _coord_to_region_convert 1672 _coord_to_region_convert
1673 (grp->wsd, x, y, grp->wsd->size.w, &grp->lon, &grp->lat); 1673 (grp->wsd, x, y, grp->wsd->size.w, &grp->lon, &grp->lat);
1674 1674
1675 if (grp->members) eina_list_free(grp->members); 1675 eina_list_free(grp->members);
1676 grp->members = members; 1676 grp->members = members;
1677 snprintf(text, sizeof(text), "%d", eina_list_count(members)); 1677 snprintf(text, sizeof(text), "%d", eina_list_count(members));
1678 1678
@@ -1728,9 +1728,9 @@ _overlay_group_free(Overlay_Group *grp)
1728{ 1728{
1729 EINA_SAFETY_ON_NULL_RETURN(grp); 1729 EINA_SAFETY_ON_NULL_RETURN(grp);
1730 1730
1731 if (grp->overlay) free(grp->overlay); 1731 free(grp->overlay);
1732 if (grp->ovl) _overlay_default_free(grp->ovl); 1732 if (grp->ovl) _overlay_default_free(grp->ovl);
1733 if (grp->members) eina_list_free(grp->members); 1733 eina_list_free(grp->members);
1734 1734
1735 free(grp); 1735 free(grp);
1736} 1736}
@@ -1777,7 +1777,7 @@ _overlay_class_icon_update(Overlay_Class *ovl,
1777 EINA_SAFETY_ON_NULL_RETURN(ovl); 1777 EINA_SAFETY_ON_NULL_RETURN(ovl);
1778 1778
1779 if (ovl->icon == icon) return; 1779 if (ovl->icon == icon) return;
1780 if (ovl->icon) evas_object_del(ovl->icon); 1780 evas_object_del(ovl->icon);
1781 ovl->icon = icon; 1781 ovl->icon = icon;
1782 // For using proxy, it should have size and be shown but moved away to hide. 1782 // For using proxy, it should have size and be shown but moved away to hide.
1783 evas_object_resize(icon, 32, 32); 1783 evas_object_resize(icon, 32, 32);
@@ -1804,7 +1804,7 @@ _overlay_class_content_update(Overlay_Class *ovl,
1804 EINA_SAFETY_ON_NULL_RETURN(ovl); 1804 EINA_SAFETY_ON_NULL_RETURN(ovl);
1805 1805
1806 if (ovl->content == content) return; 1806 if (ovl->content == content) return;
1807 if (ovl->content) evas_object_del(ovl->content); 1807 evas_object_del(ovl->content);
1808 ovl->content = content; 1808 ovl->content = content;
1809 // For using proxy, it should have size and be shown but moved away to hide. 1809 // For using proxy, it should have size and be shown but moved away to hide.
1810 // content should have it's own size 1810 // content should have it's own size
@@ -1855,8 +1855,8 @@ _overlay_class_free(Overlay_Class *clas)
1855 _overlay_default_class_icon_update(overlay->ovl, NULL); 1855 _overlay_default_class_icon_update(overlay->ovl, NULL);
1856 } 1856 }
1857 } 1857 }
1858 if (clas->icon) evas_object_del(clas->icon); 1858 evas_object_del(clas->icon);
1859 if (clas->members) eina_list_free(clas->members); 1859 eina_list_free(clas->members);
1860 1860
1861 free(clas); 1861 free(clas);
1862} 1862}
@@ -2077,7 +2077,7 @@ _overlay_route_free(Overlay_Route *route)
2077 2077
2078 EINA_LIST_FREE(route->nodes, n) 2078 EINA_LIST_FREE(route->nodes, n)
2079 { 2079 {
2080 if (n->pos.address) eina_stringshare_del(n->pos.address); 2080 eina_stringshare_del(n->pos.address);
2081 free(n); 2081 free(n);
2082 } 2082 }
2083 2083
@@ -3130,7 +3130,7 @@ _name_request(const Evas_Object *obj,
3130 &(name->job), sd->ua) || !(name->job)) 3130 &(name->job), sd->ua) || !(name->job))
3131 { 3131 {
3132 ERR("Can't request Name from %s to %s", url, name->fname); 3132 ERR("Can't request Name from %s to %s", url, name->fname);
3133 if (name->address) free(name->address); 3133 free(name->address);
3134 free(name->fname); 3134 free(name->fname);
3135 free(name); 3135 free(name);
3136 free(fname); 3136 free(fname);
@@ -4090,7 +4090,7 @@ _elm_map_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
4090 4090
4091 _grid_all_clear(sd); 4091 _grid_all_clear(sd);
4092 // Removal of download list should be after grid clear. 4092 // Removal of download list should be after grid clear.
4093 if (sd->download_idler) ecore_idler_del(sd->download_idler); 4093 ecore_idler_del(sd->download_idler);
4094 eina_list_free(sd->download_list); 4094 eina_list_free(sd->download_list);
4095 4095
4096 _source_all_unload(sd); 4096 _source_all_unload(sd);
@@ -4797,10 +4797,10 @@ _route_add(Eo *obj, void *_pd, va_list *list)
4797 if (!url) 4797 if (!url)
4798 { 4798 {
4799 ERR("Route URL is NULL"); 4799 ERR("Route URL is NULL");
4800 if (type_name) free(type_name); 4800 free(type_name);
4801 return; 4801 return;
4802 } 4802 }
4803 if (type_name) free(type_name); 4803 free(type_name);
4804 4804
4805 route = ELM_NEW(Elm_Map_Route); 4805 route = ELM_NEW(Elm_Map_Route);
4806 route->wsd = sd; 4806 route->wsd = sd;
@@ -4848,13 +4848,13 @@ elm_map_route_del(Elm_Map_Route *route)
4848 4848
4849 EINA_LIST_FREE(route->waypoint, w) 4849 EINA_LIST_FREE(route->waypoint, w)
4850 { 4850 {
4851 if (w->point) eina_stringshare_del(w->point); 4851 eina_stringshare_del(w->point);
4852 free(w); 4852 free(w);
4853 } 4853 }
4854 4854
4855 EINA_LIST_FREE(route->nodes, n) 4855 EINA_LIST_FREE(route->nodes, n)
4856 { 4856 {
4857 if (n->pos.address) eina_stringshare_del(n->pos.address); 4857 eina_stringshare_del(n->pos.address);
4858 free(n); 4858 free(n);
4859 } 4859 }
4860 4860
@@ -4939,8 +4939,8 @@ elm_map_name_del(Elm_Map_Name *name)
4939 EINA_SAFETY_ON_NULL_RETURN(name->wsd); 4939 EINA_SAFETY_ON_NULL_RETURN(name->wsd);
4940 ELM_MAP_CHECK((name->wsd)->obj); 4940 ELM_MAP_CHECK((name->wsd)->obj);
4941 4941
4942 if (name->job) ecore_file_download_abort(name->job); 4942 ecore_file_download_abort(name->job);
4943 if (name->address) free(name->address); 4943 free(name->address);
4944 if (name->fname) 4944 if (name->fname)
4945 { 4945 {
4946 ecore_file_remove(name->fname); 4946 ecore_file_remove(name->fname);
diff --git a/src/lib/elm_mapbuf.c b/src/lib/elm_mapbuf.c
index bbb88e4b6..3aff346e7 100644
--- a/src/lib/elm_mapbuf.c
+++ b/src/lib/elm_mapbuf.c
@@ -220,7 +220,7 @@ _elm_mapbuf_smart_content_set(Eo *obj, void *_pd, va_list *list)
220 return; 220 return;
221 } 221 }
222 222
223 if (sd->content) evas_object_del(sd->content); 223 evas_object_del(sd->content);
224 sd->content = content; 224 sd->content = content;
225 225
226 if (content) 226 if (content)
@@ -330,8 +330,7 @@ _destructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
330{ 330{
331 Elm_Mapbuf_Smart_Data *priv = _pd; 331 Elm_Mapbuf_Smart_Data *priv = _pd;
332 332
333 if (priv->idler) ecore_idler_del(priv->idler); 333 ELM_SAFE_FREE(priv->idler, ecore_idler_del);
334 priv->idler = NULL;
335 334
336 eo_do_super(obj, MY_CLASS, eo_destructor()); 335 eo_do_super(obj, MY_CLASS, eo_destructor());
337} 336}
diff --git a/src/lib/elm_menu.c b/src/lib/elm_menu.c
index d0ea733ee..f41b75c5a 100644
--- a/src/lib/elm_menu.c
+++ b/src/lib/elm_menu.c
@@ -48,10 +48,10 @@ _item_del(Elm_Menu_Item *item)
48 EINA_LIST_FREE(item->submenu.items, child) 48 EINA_LIST_FREE(item->submenu.items, child)
49 _item_del(child); 49 _item_del(child);
50 50
51 if (item->label) eina_stringshare_del(item->label); 51 eina_stringshare_del(item->label);
52 if (item->submenu.hv) evas_object_del(item->submenu.hv); 52 evas_object_del(item->submenu.hv);
53 if (item->submenu.location) evas_object_del(item->submenu.location); 53 evas_object_del(item->submenu.location);
54 if (item->icon_str) eina_stringshare_del(item->icon_str); 54 eina_stringshare_del(item->icon_str);
55 55
56 elm_widget_item_free(item); 56 elm_widget_item_free(item);
57} 57}
@@ -305,8 +305,7 @@ _item_content_set_hook(Elm_Object_Item *it,
305 item = (Elm_Menu_Item *)it; 305 item = (Elm_Menu_Item *)it;
306 if (content == item->content) return; 306 if (content == item->content) return;
307 307
308 if (item->content) evas_object_del(item->content); 308 evas_object_del(item->content);
309
310 item->content = content; 309 item->content = content;
311 if (item->content) 310 if (item->content)
312 elm_layout_content_set(VIEW(item), "elm.swallow.content", item->content); 311 elm_layout_content_set(VIEW(item), "elm.swallow.content", item->content);
@@ -634,8 +633,8 @@ _elm_menu_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
634 evas_object_event_callback_del_full 633 evas_object_event_callback_del_full
635 (sd->bx, EVAS_CALLBACK_RESIZE, _menu_resize_cb, obj); 634 (sd->bx, EVAS_CALLBACK_RESIZE, _menu_resize_cb, obj);
636 635
637 if (sd->hv) evas_object_del(sd->hv); 636 evas_object_del(sd->hv);
638 if (sd->location) evas_object_del(sd->location); 637 evas_object_del(sd->location);
639 638
640 eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); 639 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
641} 640}
@@ -906,10 +905,10 @@ _item_del_pre_hook(Elm_Object_Item *it)
906 ELM_MENU_DATA_GET(WIDGET(item), sd); 905 ELM_MENU_DATA_GET(WIDGET(item), sd);
907 906
908 elm_menu_item_subitems_clear(it); 907 elm_menu_item_subitems_clear(it);
909 if (item->label) eina_stringshare_del(item->label); 908 eina_stringshare_del(item->label);
910 if (item->content) evas_object_del(item->content); 909 evas_object_del(item->content);
911 if (item->submenu.hv) evas_object_del(item->submenu.hv); 910 evas_object_del(item->submenu.hv);
912 if (item->submenu.location) evas_object_del(item->submenu.location); 911 evas_object_del(item->submenu.location);
913 912
914 if (item->parent) 913 if (item->parent)
915 item->parent->submenu.items = 914 item->parent->submenu.items =
diff --git a/src/lib/elm_module.c b/src/lib/elm_module.c
index f0e0903a0..777ea6c6f 100644
--- a/src/lib/elm_module.c
+++ b/src/lib/elm_module.c
@@ -56,12 +56,10 @@ _elm_module_shutdown(void)
56 56
57 EINA_LIST_FREE(tl, m) _elm_module_del(m); 57 EINA_LIST_FREE(tl, m) _elm_module_del(m);
58 58
59 eina_hash_free(modules); 59 ELM_SAFE_FREE(modules, eina_hash_free);
60 modules = NULL;
61 } 60 }
62 61
63 if (modules_as) eina_hash_free(modules_as); 62 ELM_SAFE_FREE(modules_as, eina_hash_free);
64 modules_as = NULL;
65} 63}
66 64
67void 65void
diff --git a/src/lib/elm_notify.c b/src/lib/elm_notify.c
index def1d6c4d..c03adb4db 100644
--- a/src/lib/elm_notify.c
+++ b/src/lib/elm_notify.c
@@ -405,7 +405,7 @@ _elm_notify_smart_content_set(Eo *obj, void *_pd, va_list *list)
405 if (part && strcmp(part, "default")) return; 405 if (part && strcmp(part, "default")) return;
406 if (sd->content == content) goto end; 406 if (sd->content == content) goto end;
407 407
408 if (sd->content) evas_object_del(sd->content); 408 evas_object_del(sd->content);
409 sd->content = content; 409 sd->content = content;
410 410
411 if (content) 411 if (content)
diff --git a/src/lib/elm_photocam.c b/src/lib/elm_photocam.c
index 661e18394..2639d7228 100644
--- a/src/lib/elm_photocam.c
+++ b/src/lib/elm_photocam.c
@@ -513,8 +513,7 @@ _grid_clear(Evas_Object *obj,
513 } 513 }
514 } 514 }
515 515
516 free(g->grid); 516 ELM_SAFE_FREE(g->grid, free);
517 g->grid = NULL;
518 g->gw = 0; 517 g->gw = 0;
519 g->gh = 0; 518 g->gh = 0;
520} 519}
@@ -1404,12 +1403,11 @@ _elm_photocam_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1404 1403
1405 EINA_LIST_FREE(sd->grids, g) 1404 EINA_LIST_FREE(sd->grids, g)
1406 { 1405 {
1407 if (g->grid) free(g->grid); 1406 free(g->grid);
1408 free(g); 1407 free(g);
1409 } 1408 }
1410 eo_unref(sd->pan_obj); 1409 eo_unref(sd->pan_obj);
1411 evas_object_del(sd->pan_obj); 1410 ELM_SAFE_FREE(sd->pan_obj, evas_object_del);
1412 sd->pan_obj = NULL;
1413 1411
1414 if (sd->f) eina_file_close(sd->f); 1412 if (sd->f) eina_file_close(sd->f);
1415 free(sd->remote_data); 1413 free(sd->remote_data);
@@ -1557,7 +1555,7 @@ _elm_photocam_download_done(void *data, Elm_Url *url EINA_UNUSED, Eina_Binbuf *d
1557 size_t length; 1555 size_t length;
1558 Evas_Load_Error ret = EVAS_LOAD_ERROR_NONE; 1556 Evas_Load_Error ret = EVAS_LOAD_ERROR_NONE;
1559 1557
1560 if (sd->remote_data) free(sd->remote_data); 1558 free(sd->remote_data);
1561 length = eina_binbuf_length_get(download); 1559 length = eina_binbuf_length_get(download);
1562 sd->remote_data = eina_binbuf_string_steal(download); 1560 sd->remote_data = eina_binbuf_string_steal(download);
1563 f = eina_file_virtualize(_elm_url_get(url), 1561 f = eina_file_virtualize(_elm_url_get(url),
@@ -2262,11 +2260,7 @@ _gesture_enabled_set(Eo *obj, void *_pd, va_list *list)
2262 2260
2263 sd->do_gesture = gesture; 2261 sd->do_gesture = gesture;
2264 2262
2265 if (sd->g_layer) 2263 ELM_SAFE_FREE(sd->g_layer, evas_object_del);
2266 {
2267 evas_object_del(sd->g_layer);
2268 sd->g_layer = NULL;
2269 }
2270 2264
2271 if (!gesture) return; 2265 if (!gesture) return;
2272 2266
diff --git a/src/lib/elm_prefs.c b/src/lib/elm_prefs.c
index 443b49ea0..ff487e015 100644
--- a/src/lib/elm_prefs.c
+++ b/src/lib/elm_prefs.c
@@ -1034,13 +1034,11 @@ _elm_prefs_page_populate(Elm_Prefs_Page_Node *page,
1034err: 1034err:
1035 EINA_LIST_FOREACH(page->items, l, it) 1035 EINA_LIST_FOREACH(page->items, l, it)
1036 { 1036 {
1037 if (it->w_obj) evas_object_del(it->w_obj); 1037 ELM_SAFE_FREE(it->w_obj, evas_object_del);
1038 it->w_obj = NULL;
1039 it->w_impl = NULL; 1038 it->w_impl = NULL;
1040 } 1039 }
1041 1040
1042 if (page->w_obj) evas_object_del(page->w_obj); 1041 ELM_SAFE_FREE(page->w_obj, evas_object_del);
1043 page->w_obj = NULL;
1044 page->w_impl = NULL; 1042 page->w_impl = NULL;
1045 1043
1046 return EINA_FALSE; 1044 return EINA_FALSE;
@@ -2084,10 +2082,10 @@ _prefs_item_del_cb(void *data EINA_UNUSED,
2084 2082
2085 it = evas_object_data_get(obj, "prefs_item"); 2083 it = evas_object_data_get(obj, "prefs_item");
2086 lbl = evas_object_data_del(it->w_obj, "label_widget"); 2084 lbl = evas_object_data_del(it->w_obj, "label_widget");
2087 if (lbl) evas_object_del(lbl); 2085 evas_object_del(lbl);
2088 2086
2089 icon = evas_object_data_del(it->w_obj, "icon_widget"); 2087 icon = evas_object_data_del(it->w_obj, "icon_widget");
2090 if (icon) evas_object_del(icon); 2088 evas_object_del(icon);
2091 2089
2092 ELM_PREFS_DATA_GET(it->prefs, sd); 2090 ELM_PREFS_DATA_GET(it->prefs, sd);
2093 2091
diff --git a/src/lib/elm_prefs_data.c b/src/lib/elm_prefs_data.c
index 6583c14be..88d490088 100644
--- a/src/lib/elm_prefs_data.c
+++ b/src/lib/elm_prefs_data.c
@@ -299,8 +299,7 @@ _eet_data_load(Elm_Prefs_Data *prefs_data,
299 default: 299 default:
300 ERR("bad item (type = %d) fetched from data file %s, skipping it", 300 ERR("bad item (type = %d) fetched from data file %s, skipping it",
301 it->type, prefs_data->data_file); 301 it->type, prefs_data->data_file);
302 free(item); 302 ELM_SAFE_FREE(item, free);
303 item = NULL;
304 skip = EINA_TRUE; 303 skip = EINA_TRUE;
305 break; 304 break;
306 } 305 }
@@ -311,8 +310,7 @@ _eet_data_load(Elm_Prefs_Data *prefs_data,
311 skip = EINA_TRUE; 310 skip = EINA_TRUE;
312 311
313 if (set_err) eina_value_flush(&(item->value)); 312 if (set_err) eina_value_flush(&(item->value));
314 free(item); 313 ELM_SAFE_FREE(item, free);
315 item = NULL;
316 } 314 }
317 315
318 if (!skip) eina_hash_set(map, it->name, item); 316 if (!skip) eina_hash_set(map, it->name, item);
diff --git a/src/lib/elm_progressbar.c b/src/lib/elm_progressbar.c
index 3bb6f7709..c38287529 100644
--- a/src/lib/elm_progressbar.c
+++ b/src/lib/elm_progressbar.c
@@ -306,7 +306,7 @@ _elm_progressbar_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
306 Elm_Progressbar_Smart_Data *sd = _pd; 306 Elm_Progressbar_Smart_Data *sd = _pd;
307 Elm_Progress_Status *progress_obj; 307 Elm_Progress_Status *progress_obj;
308 308
309 if (sd->units) eina_stringshare_del(sd->units); 309 eina_stringshare_del(sd->units);
310 if (sd->progress_status) 310 if (sd->progress_status)
311 { 311 {
312 EINA_LIST_FREE(sd->progress_status, progress_obj) 312 EINA_LIST_FREE(sd->progress_status, progress_obj)
diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c
index 0391bfff2..00d61f907 100644
--- a/src/lib/elm_scroller.c
+++ b/src/lib/elm_scroller.c
@@ -654,7 +654,7 @@ _elm_scroller_smart_content_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
654 654
655 if (sd->content == content) return; 655 if (sd->content == content) return;
656 656
657 if (sd->content) evas_object_del(sd->content); 657 evas_object_del(sd->content);
658 sd->content = content; 658 sd->content = content;
659 659
660 if (content) 660 if (content)
diff --git a/src/lib/elm_segment_control.c b/src/lib/elm_segment_control.c
index 0f6c0a904..2d46089b3 100644
--- a/src/lib/elm_segment_control.c
+++ b/src/lib/elm_segment_control.c
@@ -67,8 +67,8 @@ _item_free(Elm_Segment_Item *it)
67 if (sd->selected_item == it) sd->selected_item = NULL; 67 if (sd->selected_item == it) sd->selected_item = NULL;
68 if (sd->items) sd->items = eina_list_remove(sd->items, it); 68 if (sd->items) sd->items = eina_list_remove(sd->items, it);
69 69
70 if (it->icon) evas_object_del(it->icon); 70 evas_object_del(it->icon);
71 if (it->label) eina_stringshare_del(it->label); 71 eina_stringshare_del(it->label);
72} 72}
73 73
74static void 74static void
@@ -460,7 +460,7 @@ _item_content_set_hook(Elm_Object_Item *it,
460 { 460 {
461 if (content == item->icon) return; 461 if (content == item->icon) return;
462 462
463 if (item->icon) evas_object_del(item->icon); 463 evas_object_del(item->icon);
464 item->icon = content; 464 item->icon = content;
465 if (!item->icon) 465 if (!item->icon)
466 { 466 {
diff --git a/src/lib/elm_slideshow.c b/src/lib/elm_slideshow.c
index dcdf5f557..f2eb4d285 100644
--- a/src/lib/elm_slideshow.c
+++ b/src/lib/elm_slideshow.c
@@ -223,8 +223,7 @@ _item_realize(Elm_Slideshow_Item *item)
223 (sd->items_built, sd->items_built); 223 (sd->items_built, sd->items_built);
224 if (item->itc->func.del) 224 if (item->itc->func.del)
225 item->itc->func.del(elm_widget_item_data_get(item), VIEW(item)); 225 item->itc->func.del(elm_widget_item_data_get(item), VIEW(item));
226 evas_object_del(VIEW(item)); 226 ELM_SAFE_FREE(VIEW(item), evas_object_del);
227 VIEW(item) = NULL;
228 } 227 }
229} 228}
230 229
@@ -355,7 +354,7 @@ _elm_slideshow_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
355 const char *layout; 354 const char *layout;
356 355
357 elm_slideshow_clear(obj); 356 elm_slideshow_clear(obj);
358 if (sd->transitions) elm_widget_stringlist_free(sd->transitions); 357 elm_widget_stringlist_free(sd->transitions);
359 ecore_timer_del(sd->timer); 358 ecore_timer_del(sd->timer);
360 359
361 EINA_LIST_FREE(sd->layout.list, layout) 360 EINA_LIST_FREE(sd->layout.list, layout)
diff --git a/src/lib/elm_store.c b/src/lib/elm_store.c
index c96049b74..fda2e0be9 100644
--- a/src/lib/elm_store.c
+++ b/src/lib/elm_store.c
@@ -399,7 +399,7 @@ _store_filesystem_list_do(void *data, Ecore_Thread *th EINA_UNUSED)
399 } 399 }
400 else 400 else
401 { 401 {
402 if (info->base.sort_id) free(info->base.sort_id); 402 free(info->base.sort_id);
403 free(info); 403 free(info);
404 } 404 }
405 if (ecore_thread_check(th)) break; 405 if (ecore_thread_check(th)) break;
@@ -469,7 +469,7 @@ _store_filesystem_list_update(void *data, Ecore_Thread *th EINA_UNUSED, void *ms
469 NULL/* func data */); 469 NULL/* func data */);
470 st->items = eina_inlist_append(st->items, (Eina_Inlist *)sti); 470 st->items = eina_inlist_append(st->items, (Eina_Inlist *)sti);
471done: 471done:
472 if (info->base.sort_id) free(info->base.sort_id); 472 free(info->base.sort_id);
473 free(info); 473 free(info);
474} 474}
475 475
diff --git a/src/lib/elm_theme.c b/src/lib/elm_theme.c
index bbfca950b..58ff891b4 100644
--- a/src/lib/elm_theme.c
+++ b/src/lib/elm_theme.c
@@ -260,7 +260,7 @@ _elm_theme_idler_clean(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object
260 Ecore_Idler *idler; 260 Ecore_Idler *idler;
261 261
262 idler = evas_object_data_get(obj, "elm-theme-reload-idler"); 262 idler = evas_object_data_get(obj, "elm-theme-reload-idler");
263 if (idler) ecore_idler_del(idler); 263 ecore_idler_del(idler);
264 evas_object_data_del(obj, "elm-theme-reload-idler"); 264 evas_object_data_del(obj, "elm-theme-reload-idler");
265} 265}
266 266
diff --git a/src/lib/elm_thumb.c b/src/lib/elm_thumb.c
index 533c5405d..6b00582ed 100644
--- a/src/lib/elm_thumb.c
+++ b/src/lib/elm_thumb.c
@@ -206,8 +206,7 @@ _thumb_finish(Elm_Thumb_Smart_Data *sd,
206 evas = evas_object_evas_get(sd->obj); 206 evas = evas_object_evas_get(sd->obj);
207 if ((sd->view) && (sd->is_video ^ sd->was_video)) 207 if ((sd->view) && (sd->is_video ^ sd->was_video))
208 { 208 {
209 evas_object_del(sd->view); 209 ELM_SAFE_FREE(sd->view, evas_object_del);
210 sd->view = NULL;
211 } 210 }
212 sd->was_video = sd->is_video; 211 sd->was_video = sd->is_video;
213 212
@@ -287,14 +286,9 @@ _thumb_finish(Elm_Thumb_Smart_Data *sd,
287 EINA_LIST_FREE(retry, sd) 286 EINA_LIST_FREE(retry, sd)
288 { 287 {
289 eo_data_unref(sd->obj, sd); 288 eo_data_unref(sd->obj, sd);
290 eina_stringshare_del(sd->thumb.thumb_path); 289 ELM_SAFE_FREE(sd->thumb.thumb_path, eina_stringshare_del);
291 sd->thumb.thumb_path = NULL; 290 ELM_SAFE_FREE(sd->thumb.thumb_key, eina_stringshare_del);
292 291 ELM_SAFE_FREE(sd->view, evas_object_del);
293 eina_stringshare_del(sd->thumb.thumb_key);
294 sd->thumb.thumb_key = NULL;
295
296 evas_object_del(sd->view);
297 sd->view = NULL;
298 292
299 wd = eo_data_scope_get(sd->obj, ELM_OBJ_WIDGET_CLASS); 293 wd = eo_data_scope_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
300 edje_object_signal_emit 294 edje_object_signal_emit
@@ -580,19 +574,14 @@ _elm_thumb_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
580 (sd->view, EVAS_CALLBACK_IMAGE_PRELOADED, _on_thumb_preloaded, 574 (sd->view, EVAS_CALLBACK_IMAGE_PRELOADED, _on_thumb_preloaded,
581 sd); 575 sd);
582 576
583 if (sd->view) 577 ELM_SAFE_FREE(sd->view, evas_object_del);
584 {
585 evas_object_del(sd->view);
586 sd->view = NULL;
587 }
588
589 eina_stringshare_del(sd->thumb.thumb_path); 578 eina_stringshare_del(sd->thumb.thumb_path);
590 eina_stringshare_del(sd->thumb.thumb_key); 579 eina_stringshare_del(sd->thumb.thumb_key);
591 580
592 eina_stringshare_del(sd->file); 581 eina_stringshare_del(sd->file);
593 eina_stringshare_del(sd->key); 582 eina_stringshare_del(sd->key);
594 583
595 if (sd->eeh) ecore_event_handler_del(sd->eeh); 584 ecore_event_handler_del(sd->eeh);
596 585
597 eo_do_super(obj, MY_CLASS, evas_obj_smart_del()); 586 eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
598} 587}
diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c
index 8c37d3bbd..dc49542ef 100644
--- a/src/lib/elm_toolbar.c
+++ b/src/lib/elm_toolbar.c
@@ -121,11 +121,7 @@ _items_visibility_fix(Elm_Toolbar_Smart_Data *sd,
121static void 121static void
122_item_menu_destroy(Elm_Toolbar_Item *item) 122_item_menu_destroy(Elm_Toolbar_Item *item)
123{ 123{
124 if (item->o_menu) 124 ELM_SAFE_FREE(item->o_menu, evas_object_del);
125 {
126 evas_object_del(item->o_menu);
127 item->o_menu = NULL;
128 }
129 item->menu = EINA_FALSE; 125 item->menu = EINA_FALSE;
130} 126}
131 127
@@ -934,10 +930,10 @@ _item_del(Elm_Toolbar_Item *it)
934 evas_object_del(it->icon); 930 evas_object_del(it->icon);
935 } 931 }
936 932
937 if (it->object) evas_object_del(it->object); 933 evas_object_del(it->object);
938 //TODO: See if checking for sd->menu_parent is necessary before 934 //TODO: See if checking for sd->menu_parent is necessary before
939 //deleting menu 935 //deleting menu
940 if (it->o_menu) evas_object_del(it->o_menu); 936 evas_object_del(it->o_menu);
941} 937}
942 938
943static void 939static void
@@ -1346,7 +1342,7 @@ _item_content_set_hook(Elm_Object_Item *it,
1346 if (part && strcmp(part, "object")) return; 1342 if (part && strcmp(part, "object")) return;
1347 if (item->object == content) return; 1343 if (item->object == content) return;
1348 1344
1349 if (item->object) evas_object_del(item->object); 1345 evas_object_del(item->object);
1350 1346
1351 item->object = content; 1347 item->object = content;
1352 if (item->object) 1348 if (item->object)
@@ -1574,8 +1570,7 @@ _transit_del_cb(void *data, Elm_Transit *transit EINA_UNUSED)
1574 if (item->proxy) 1570 if (item->proxy)
1575 { 1571 {
1576 evas_object_image_source_visible_set(elm_image_object_get(item->proxy), EINA_TRUE); 1572 evas_object_image_source_visible_set(elm_image_object_get(item->proxy), EINA_TRUE);
1577 evas_object_del(item->proxy); 1573 ELM_SAFE_FREE(item->proxy, evas_object_del);
1578 item->proxy = NULL;
1579 } 1574 }
1580 item->trans = NULL; 1575 item->trans = NULL;
1581 1576
@@ -1759,8 +1754,7 @@ _mouse_up_reorder(Elm_Toolbar_Item *it,
1759 if (it->proxy) 1754 if (it->proxy)
1760 { 1755 {
1761 evas_object_image_source_visible_set(elm_image_object_get(it->proxy), EINA_TRUE); 1756 evas_object_image_source_visible_set(elm_image_object_get(it->proxy), EINA_TRUE);
1762 evas_object_del(it->proxy); 1757 ELM_SAFE_FREE(it->proxy, evas_object_del);
1763 it->proxy = NULL;
1764 } 1758 }
1765 1759
1766 eo_do(obj, elm_scrollable_interface_hold_set(EINA_FALSE)); 1760 eo_do(obj, elm_scrollable_interface_hold_set(EINA_FALSE));
@@ -3557,8 +3551,7 @@ elm_toolbar_item_state_add(Elm_Object_Item *it,
3557 3551
3558 if (!_item_icon_set(icon_obj, "toolbar/", icon)) 3552 if (!_item_icon_set(icon_obj, "toolbar/", icon))
3559 { 3553 {
3560 evas_object_del(icon_obj); 3554 ELM_SAFE_FREE(icon_obj, evas_object_del);
3561 icon_obj = NULL;
3562 icon = NULL; 3555 icon = NULL;
3563 } 3556 }
3564 3557
@@ -3602,7 +3595,7 @@ elm_toolbar_item_state_del(Elm_Object_Item *it,
3602 3595
3603 eina_stringshare_del(state->label); 3596 eina_stringshare_del(state->label);
3604 eina_stringshare_del(state->icon_str); 3597 eina_stringshare_del(state->icon_str);
3605 if (state->icon) evas_object_del(state->icon); 3598 evas_object_del(state->icon);
3606 free(state); 3599 free(state);
3607 3600
3608 item->states = eina_list_remove_list(item->states, del_state); 3601 item->states = eina_list_remove_list(item->states, del_state);
diff --git a/src/lib/elm_transit.c b/src/lib/elm_transit.c
index cac364a65..d8a2d3e9d 100644
--- a/src/lib/elm_transit.c
+++ b/src/lib/elm_transit.c
@@ -118,10 +118,9 @@ _transit_obj_data_update(Elm_Transit *transit, Evas_Object *obj)
118 118
119 obj_data->freeze_events = evas_object_freeze_events_get(obj); 119 obj_data->freeze_events = evas_object_freeze_events_get(obj);
120 120
121 if ((!transit->state_keep) && (obj_data->state)) 121 if (!transit->state_keep)
122 { 122 {
123 free(obj_data->state); 123 ELM_SAFE_FREE(obj_data->state, free);
124 obj_data->state = NULL;
125 } 124 }
126 else 125 else
127 { 126 {
@@ -172,8 +171,7 @@ _transit_obj_remove_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *
172 Elm_Transit_Obj_Data *obj_data = evas_object_data_get(obj, _transit_key); 171 Elm_Transit_Obj_Data *obj_data = evas_object_data_get(obj, _transit_key);
173 if (obj_data) 172 if (obj_data)
174 { 173 {
175 if (obj_data->state) 174 free(obj_data->state);
176 free(obj_data->state);
177 free(obj_data); 175 free(obj_data);
178 } 176 }
179 _remove_obj_from_list(transit, obj); 177 _remove_obj_from_list(transit, obj);
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 086361887..37859ae10 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -328,10 +328,10 @@ _elm_widget_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
328 EINA_LIST_FREE(sd->event_cb, ecb) 328 EINA_LIST_FREE(sd->event_cb, ecb)
329 free(ecb); 329 free(ecb);
330 330
331 if (sd->style) eina_stringshare_del(sd->style); 331 eina_stringshare_del(sd->style);
332 if (sd->theme) elm_theme_free(sd->theme); 332 if (sd->theme) elm_theme_free(sd->theme);
333 _if_focused_revert(obj, EINA_TRUE); 333 _if_focused_revert(obj, EINA_TRUE);
334 if (sd->access_info) eina_stringshare_del(sd->access_info); 334 eina_stringshare_del(sd->access_info);
335 evas_object_smart_data_set(obj, NULL); 335 evas_object_smart_data_set(obj, NULL);
336} 336}
337 337
@@ -3946,8 +3946,7 @@ _part_text_translatable_set(Eina_Inlist **translate_strings, const char *part, E
3946 eina_stringshare_del(ts->id); 3946 eina_stringshare_del(ts->id);
3947 eina_stringshare_del(ts->domain); 3947 eina_stringshare_del(ts->domain);
3948 eina_stringshare_del(ts->string); 3948 eina_stringshare_del(ts->string);
3949 free(ts); 3949 ELM_SAFE_FREE(ts, free);
3950 ts = NULL;
3951 } 3950 }
3952 } 3951 }
3953 3952
@@ -4170,7 +4169,7 @@ _elm_widget_access_info_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
4170{ 4169{
4171 const char *txt = va_arg(*list, const char *); 4170 const char *txt = va_arg(*list, const char *);
4172 Elm_Widget_Smart_Data *sd = _pd; 4171 Elm_Widget_Smart_Data *sd = _pd;
4173 if (sd->access_info) eina_stringshare_del(sd->access_info); 4172 eina_stringshare_del(sd->access_info);
4174 if (!txt) sd->access_info = NULL; 4173 if (!txt) sd->access_info = NULL;
4175 else sd->access_info = eina_stringshare_add(txt); 4174 else sd->access_info = eina_stringshare_add(txt);
4176} 4175}
@@ -5063,11 +5062,9 @@ _elm_widget_item_free(Elm_Widget_Item *item)
5063 if (item->del_func) 5062 if (item->del_func)
5064 item->del_func((void *)item->data, item->widget, item); 5063 item->del_func((void *)item->data, item->widget, item);
5065 5064
5066 if (item->view) 5065 evas_object_del(item->view);
5067 evas_object_del(item->view);
5068 5066
5069 if (item->access_info) 5067 eina_stringshare_del(item->access_info);
5070 eina_stringshare_del(item->access_info);
5071 5068
5072 while (item->signals) 5069 while (item->signals)
5073 _elm_widget_item_signal_callback_list_get(item, item->signals); 5070 _elm_widget_item_signal_callback_list_get(item, item->signals);
@@ -6079,7 +6076,7 @@ _elm_widget_item_access_info_set(Elm_Widget_Item *item,
6079 const char *txt) 6076 const char *txt)
6080{ 6077{
6081 ELM_WIDGET_ITEM_CHECK_OR_RETURN(item); 6078 ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
6082 if (item->access_info) eina_stringshare_del(item->access_info); 6079 eina_stringshare_del(item->access_info);
6083 if (!txt) item->access_info = NULL; 6080 if (!txt) item->access_info = NULL;
6084 else item->access_info = eina_stringshare_add(txt); 6081 else item->access_info = eina_stringshare_add(txt);
6085} 6082}
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index 2e493242b..3ef1daca5 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -491,8 +491,8 @@ _shot_do(Elm_Win_Smart_Data *sd)
491 file, key, flags); 491 file, key, flags);
492 } 492 }
493 free(file); 493 free(file);
494 if (key) free(key); 494 free(key);
495 if (flags) free(flags); 495 free(flags);
496 ecore_evas_free(ee); 496 ecore_evas_free(ee);
497 if (sd->shot.repeat_count) sd->shot.shot_counter++; 497 if (sd->shot.repeat_count) sd->shot.shot_counter++;
498} 498}
@@ -1494,12 +1494,11 @@ _elm_win_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
1494 _elm_win_focus_highlight_shutdown(sd); 1494 _elm_win_focus_highlight_shutdown(sd);
1495 eina_stringshare_del(sd->focus_highlight.style); 1495 eina_stringshare_del(sd->focus_highlight.style);
1496 1496
1497 if (sd->title) eina_stringshare_del(sd->title); 1497 eina_stringshare_del(sd->title);
1498 if (sd->icon_name) eina_stringshare_del(sd->icon_name); 1498 eina_stringshare_del(sd->icon_name);
1499 if (sd->role) eina_stringshare_del(sd->role); 1499 eina_stringshare_del(sd->role);
1500 if (sd->icon) evas_object_del(sd->icon); 1500 evas_object_del(sd->icon);
1501 1501 evas_object_del(sd->main_menu);
1502 if (sd->main_menu) evas_object_del(sd->main_menu);
1503 1502
1504 _elm_win_profile_del(sd); 1503 _elm_win_profile_del(sd);
1505 _elm_win_available_profiles_del(sd); 1504 _elm_win_available_profiles_del(sd);
@@ -2471,8 +2470,7 @@ _elm_win_frame_add(Elm_Win_Smart_Data *sd,
2471 if (!elm_widget_theme_object_set 2470 if (!elm_widget_theme_object_set
2472 (sd->obj, sd->frame_obj, "border", "base", style)) 2471 (sd->obj, sd->frame_obj, "border", "base", style))
2473 { 2472 {
2474 evas_object_del(sd->frame_obj); 2473 ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
2475 sd->frame_obj = NULL;
2476 return; 2474 return;
2477 } 2475 }
2478 2476
@@ -2542,11 +2540,7 @@ _elm_win_frame_del(Elm_Win_Smart_Data *sd)
2542{ 2540{
2543 int w, h; 2541 int w, h;
2544 2542
2545 if (sd->client_obj) 2543 ELM_SAFE_FREE(sd->client_obj, evas_object_del);
2546 {
2547 evas_object_del(sd->client_obj);
2548 sd->client_obj = NULL;
2549 }
2550 2544
2551 if (sd->frame_obj) 2545 if (sd->frame_obj)
2552 { 2546 {
@@ -2580,8 +2574,7 @@ _elm_win_frame_del(Elm_Win_Smart_Data *sd)
2580 (sd->frame_obj, "elm,action,close", "elm", 2574 (sd->frame_obj, "elm,action,close", "elm",
2581 _elm_win_frame_cb_close); 2575 _elm_win_frame_cb_close);
2582 2576
2583 evas_object_del(sd->frame_obj); 2577 ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
2584 sd->frame_obj = NULL;
2585 } 2578 }
2586 2579
2587 evas_output_framespace_set(sd->evas, 0, 0, 0, 0); 2580 evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
@@ -2832,8 +2825,7 @@ _win_constructor(Eo *obj, void *_pd, va_list *list)
2832 tmp_sd.ee = ecore_evas_object_ecore_evas_get(tmp_sd.img_obj); 2825 tmp_sd.ee = ecore_evas_object_ecore_evas_get(tmp_sd.img_obj);
2833 if (!tmp_sd.ee) 2826 if (!tmp_sd.ee)
2834 { 2827 {
2835 evas_object_del(tmp_sd.img_obj); 2828 ELM_SAFE_FREE(tmp_sd.img_obj, evas_object_del);
2836 tmp_sd.img_obj = NULL;
2837 } 2829 }
2838 } 2830 }
2839 break; 2831 break;
diff --git a/src/lib/els_cursor.c b/src/lib/els_cursor.c
index 340fbe273..733a4bc78 100644
--- a/src/lib/els_cursor.c
+++ b/src/lib/els_cursor.c
@@ -182,8 +182,7 @@ _elm_cursor_obj_add(Evas_Object *obj, Elm_Cursor *cur)
182 if (!_elm_theme_object_set(obj, cur->obj, "cursor", cur->cursor_name, 182 if (!_elm_theme_object_set(obj, cur->obj, "cursor", cur->cursor_name,
183 cur->style ? cur->style : "default")) 183 cur->style ? cur->style : "default"))
184 { 184 {
185 evas_object_del(cur->obj); 185 ELM_SAFE_FREE(cur->obj, evas_object_del);
186 cur->obj = NULL;
187 return EINA_FALSE; 186 return EINA_FALSE;
188 } 187 }
189 188
@@ -439,8 +438,7 @@ elm_object_cursor_unset(Evas_Object *obj)
439 { 438 {
440 evas_object_event_callback_del_full(cur->obj, EVAS_CALLBACK_DEL, 439 evas_object_event_callback_del_full(cur->obj, EVAS_CALLBACK_DEL,
441 _elm_cursor_obj_del, cur); 440 _elm_cursor_obj_del, cur);
442 evas_object_del(cur->obj); 441 ELM_SAFE_FREE(cur->obj, evas_object_del);
443 cur->obj = NULL;
444 } 442 }
445 443
446 if (cur->visible) 444 if (cur->visible)
@@ -518,11 +516,7 @@ elm_object_cursor_theme_search_enabled_set(Evas_Object *obj, Eina_Bool theme_sea
518{ 516{
519 ELM_CURSOR_GET_OR_RETURN(cur, obj); 517 ELM_CURSOR_GET_OR_RETURN(cur, obj);
520 cur->theme_search = theme_search; 518 cur->theme_search = theme_search;
521 if (cur->obj) 519 ELM_SAFE_FREE(cur->obj, evas_object_del);
522 {
523 evas_object_del(cur->obj);
524 cur->obj = NULL;
525 }
526 _elm_cursor_cur_set(cur); 520 _elm_cursor_cur_set(cur);
527} 521}
528 522
diff --git a/src/lib/els_tooltip.c b/src/lib/els_tooltip.c
index 9157f312f..dc899a50e 100644
--- a/src/lib/els_tooltip.c
+++ b/src/lib/els_tooltip.c
@@ -183,8 +183,7 @@ _elm_tooltip_content_del(Elm_Tooltip *tt)
183 (tt->content, EVAS_CALLBACK_DEL, 183 (tt->content, EVAS_CALLBACK_DEL,
184 _elm_tooltip_content_del_cb, tt); 184 _elm_tooltip_content_del_cb, tt);
185 evas_object_hide(tt->content); 185 evas_object_hide(tt->content);
186 evas_object_del(tt->content); 186 ELM_SAFE_FREE(tt->content, evas_object_del);
187 tt->content = NULL;
188} 187}
189 188
190static void 189static void