if (content == sd->content) goto end;
- if (sd->content) evas_object_del(sd->content);
+ evas_object_del(sd->content);
if (sd->content == sd->list) sd->list = NULL;
evas_object_size_hint_weight_set
static void
_list_del(Elm_Ctxpopup_Smart_Data *sd)
{
- if (!sd->list) return;
-
- evas_object_del(sd->list);
- sd->list = NULL;
+ ELM_SAFE_FREE(sd->list, evas_object_del);
}
static Eina_Bool
_parent_detach(obj);
elm_ctxpopup_clear(obj);
- evas_object_del(sd->arrow);
- sd->arrow = NULL; /* stops _sizing_eval() from going on on deletion */
-
- evas_object_del(sd->bg);
- sd->bg = NULL;
+ ELM_SAFE_FREE(sd->arrow, evas_object_del); /* stops _sizing_eval() from going on on deletion */
+ ELM_SAFE_FREE(sd->bg, evas_object_del);
EINA_LIST_FREE(sd->items, it)
elm_widget_item_free(it);
}
else if (!visible)
{
- evas_object_del(sd->cancel_button);
- sd->cancel_button = NULL;
- evas_object_del(sd->ok_button);
- sd->ok_button = NULL;
+ ELM_SAFE_FREE(sd->cancel_button, evas_object_del);
+ ELM_SAFE_FREE(sd->ok_button, evas_object_del);
}
}
{
VIEW(it) = NULL;
}
- evas_object_del(sd->hover);
- sd->hover = NULL;
+ ELM_SAFE_FREE(sd->hover, evas_object_del);
evas_object_smart_callback_call(obj, SIG_DISMISSED, NULL);
}
{
if (it->content == content) return;
- if (it->content) evas_object_del(it->content);
+ evas_object_del(it->content);
it->content = content;
if (!content) return;
Evas_Object *btn)
{
if (it->title_prev_btn == btn) return;
- if (it->title_prev_btn) evas_object_del(it->title_prev_btn);
+ evas_object_del(it->title_prev_btn);
it->title_prev_btn = btn;
if (!btn) return;
Evas_Object *btn)
{
if (it->title_next_btn == btn) return;
- if (it->title_next_btn) evas_object_del(it->title_next_btn);
+ evas_object_del(it->title_next_btn);
it->title_next_btn = btn;
if (!btn) return;
Evas_Object *icon)
{
if (it->title_icon == icon) return;
- if (it->title_icon) evas_object_del(it->title_icon);
+ evas_object_del(it->title_icon);
it->title_icon = icon;
if (!icon) return;
if (!_elm_video_check(content)) return;
if (sd->video == content) goto end;
- if (sd->video) evas_object_del(sd->video);
-
+ evas_object_del(sd->video);
sd->video = content;
if (!content) goto end;
evas_object_event_callback_del
(sd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb);
- evas_object_del(sd->tbl);
+ ELM_SAFE_FREE(sd->tbl, evas_object_del);
sd->scr = NULL;
sd->box = NULL;
sd->spacer = NULL;
- sd->tbl = NULL;
}
static void
if (sd->buttons[i])
{
evas_object_del(sd->buttons[i]->btn);
- free(sd->buttons[i]);
- sd->buttons[i] = NULL;
+ ELM_SAFE_FREE(sd->buttons[i], free);
}
}
if (sd->items)
if (!sd->last_button_number)
{
_visuals_set(obj);
- evas_object_del(sd->action_area);
- sd->action_area = NULL;
+ ELM_SAFE_FREE(sd->action_area, evas_object_del);
edje_object_message_signal_process(wd->resize_obj);
}
else
{
if (it->icon == icon) return;
- if (it->icon)
- evas_object_del(it->icon);
-
+ evas_object_del(it->icon);
it->icon = icon;
if (it->icon)
{
if (sd->title_icon == icon) return EINA_TRUE;
title_visibility_old = (sd->title_text) || (sd->title_icon);
- if (sd->title_icon) evas_object_del(sd->title_icon);
+ evas_object_del(sd->title_icon);
sd->title_icon = icon;
title_visibility_current = (sd->title_text) || (sd->title_icon);
{
prev_content = elm_layout_content_get
(sd->content_area, CONTENT_PART);
- if (prev_content)
- evas_object_del(prev_content);
+ evas_object_del(prev_content);
}
//The first item is appended.
const char *p;
Eina_Bool int_ret;
- if (sd->img)
- {
- evas_object_del(sd->img);
- sd->img = NULL;
- }
+ ELM_SAFE_FREE(sd->img, evas_object_del);
if (!file)
{
ELM_SAFE_FREE(sd->file, eina_stringshare_del);
Evas_Coord mw, mh;
for (i = 0; i < 6; i++)
- {
- if (sd->digit[i])
- {
- evas_object_del(sd->digit[i]);
- sd->digit[i] = NULL;
- }
- }
- if (sd->am_pm_obj)
- {
- evas_object_del(sd->am_pm_obj);
- sd->am_pm_obj = NULL;
- }
+ ELM_SAFE_FREE(sd->digit[i], evas_object_del);
+ ELM_SAFE_FREE(sd->am_pm_obj, evas_object_del);
if ((sd->seconds) && (sd->am_pm))
{
{
if (sd->cb_data[i])
{
- evas_object_del(sd->cb_data[i]->colorbar);
- sd->cb_data[i]->colorbar = NULL;
- evas_object_del(sd->cb_data[i]->bar);
- sd->cb_data[i]->bar = NULL;
- evas_object_del(sd->cb_data[i]->lbt);
- sd->cb_data[i]->lbt = NULL;
- evas_object_del(sd->cb_data[i]->rbt);
- sd->cb_data[i]->rbt = NULL;
+ ELM_SAFE_FREE(sd->cb_data[i]->colorbar, evas_object_del);
+ ELM_SAFE_FREE(sd->cb_data[i]->bar, evas_object_del);
+ ELM_SAFE_FREE(sd->cb_data[i]->lbt, evas_object_del);
+ ELM_SAFE_FREE(sd->cb_data[i]->rbt, evas_object_del);
if (i != 0)
- {
- evas_object_del(sd->cb_data[i]->bg_rect);
- sd->cb_data[i]->bg_rect = NULL;
- }
- evas_object_del(sd->cb_data[i]->arrow);
- sd->cb_data[i]->arrow = NULL;
- evas_object_del(sd->cb_data[i]->touch_area);
- sd->cb_data[i]->touch_area = NULL;
+ ELM_SAFE_FREE(sd->cb_data[i]->bg_rect, evas_object_del);
+ ELM_SAFE_FREE(sd->cb_data[i]->arrow, evas_object_del);
+ ELM_SAFE_FREE(sd->cb_data[i]->touch_area, evas_object_del);
}
}
ELM_DISKSELECTOR_DATA_GET(WIDGET(item), sd);
sd->item_count -= 1;
eina_stringshare_del(item->label);
-
- if (item->icon)
- evas_object_del(item->icon);
+ evas_object_del(item->icon);
}
static void
{
if (it->icon == icon) return;
- if (it->icon) evas_object_del(it->icon);
+ evas_object_del(it->icon);
it->icon = icon;
if (VIEW(it))
Evas *e;
Evas_Coord w, h, mw, mh;
- if (sd->mgf_proxy) evas_object_del(sd->mgf_proxy);
- if (sd->mgf_bg) evas_object_del(sd->mgf_bg);
- if (sd->mgf_clip) evas_object_del(sd->mgf_clip);
+ evas_object_del(sd->mgf_proxy);
+ evas_object_del(sd->mgf_bg);
+ evas_object_del(sd->mgf_clip);
e = evas_object_evas_get(data);
!elm_layout_content_get(sd->anchor_hover.hover, "top") &&
!elm_layout_content_get(sd->anchor_hover.hover, "bottom"))
{
- evas_object_del(sd->anchor_hover.hover);
- sd->anchor_hover.hover = NULL;
+ ELM_SAFE_FREE(sd->anchor_hover.hover, evas_object_del);
}
else
evas_object_show(sd->anchor_hover.hover);
if (wd->content == content) return;
prev_content = _content_unset_hook(obj, part);
- if (prev_content) evas_object_del(prev_content);
+ evas_object_del(prev_content);
wd->content = content;
if (!content) return;
if (*cont == content) return EINA_TRUE;
- if (*cont) evas_object_del(*cont);
+ evas_object_del(*cont);
*cont = content;
if (content)
evas_event_freeze(evas_object_evas_get(obj));
if (sd->item_cache_max <= 0)
{
- evas_object_del(VIEW(it));
- VIEW(it) = NULL;
+ ELM_SAFE_FREE(VIEW(it), evas_object_del);
ELM_SAFE_FREE(it->spacer, evas_object_del);
evas_event_thaw(evas_object_evas_get(obj));
if (it->item->nocache_once || it->item->nocache)
{
- evas_object_del(VIEW(it));
- VIEW(it) = NULL;
+ ELM_SAFE_FREE(VIEW(it), evas_object_del);
ELM_SAFE_FREE(it->spacer, evas_object_del);
}
else
sd->queue = eina_list_free(sd->queue);
elm_genlist_clear(obj);
for (i = 0; i < 2; i++)
- {
- evas_object_del(sd->stack[i]);
- sd->stack[i] = NULL;
- }
+ ELM_SAFE_FREE(sd->stack[i], evas_object_del);
eo_unref(sd->pan_obj);
ELM_SAFE_FREE(sd->pan_obj, evas_object_del);
_elm_hover_subs_del(Elm_Hover_Smart_Data *sd)
{
ELM_HOVER_PARTS_FOREACH
- {
- if (sd->subs[i].obj)
- {
- evas_object_del(sd->subs[i].obj);
- sd->subs[i].obj = NULL;
- }
- }
+ ELM_SAFE_FREE(sd->subs[i].obj, evas_object_del);
}
static void
/* parent's edje file setting path replicated here (we got .eet
* extension, so bypassing it) */
- if (id->prev_img)
- evas_object_del(id->prev_img);
- id->prev_img = NULL;
+ ELM_SAFE_FREE(id->prev_img, evas_object_del);
if (!id->edje)
{
pclip = evas_object_clip_get(id->img);
- if (id->img) evas_object_del(id->img);
+ evas_object_del(id->img);
/* Edje object instead */
id->img = edje_object_add(evas_object_evas_get(obj));
if (!sd->edje)
{
pclip = evas_object_clip_get(sd->img);
- if (sd->img) evas_object_del(sd->img);
+ evas_object_del(sd->img);
/* Edje object instead */
sd->img = edje_object_add(evas_object_evas_get(obj));
EINA_LIST_FOREACH(sd->items, l, it)
{
- if (!VIEW(it)) continue;
if (it->level != level) continue;
-
- evas_object_del(VIEW(it));
- VIEW(it) = NULL;
+ ELM_SAFE_FREE(VIEW(it), evas_object_del);
}
sd->level_active[level] = EINA_FALSE;
}
elm_layout_content_set(obj, "elm.swallow.index.1", sd->bx[1]);
}
- else if (sd->bx[1])
- {
- evas_object_del(sd->bx[1]);
- sd->bx[1] = NULL;
- }
+ else
+ ELM_SAFE_FREE(sd->bx[1], evas_object_del);
+
if (edje_object_part_exists
(wd->resize_obj, "elm.swallow.event.1"))
{
elm_layout_content_set(obj, "elm.swallow.event.1", sd->event_rect[1]);
evas_object_size_hint_min_set(sd->event_rect[1], minw, minh);
}
- else if (sd->event_rect[1])
- {
- evas_object_del(sd->event_rect[1]);
- sd->event_rect[1] = NULL;
- }
+ else
+ ELM_SAFE_FREE(sd->event_rect[1], evas_object_del);
+
edje_object_message_signal_process(wd->resize_obj);
elm_layout_sizing_eval(obj);
}
else
{
- if (sid->pan_obj)
- {
- evas_object_del(sid->pan_obj);
- sid->pan_obj = NULL;
- }
+ ELM_SAFE_FREE(sid->pan_obj, evas_object_del);
}
if (!pan)
{
evas_object_rectangle_add(evas_object_evas_get(WIDGET(item)));
evas_object_color_set(content, 0, 0, 0, 0);
}
- if (*icon_p)
- {
- evas_object_del(*icon_p);
- *icon_p = NULL;
- }
+ evas_object_del(*icon_p);
*icon_p = content;
if (VIEW(item))
EINA_SAFETY_ON_NULL_RETURN(ovl);
if (ovl->content == content) return;
- if (ovl->content) evas_object_del(ovl->content);
+ evas_object_del(ovl->content);
ovl->content = content;
if (ovl->content)
{
EINA_SAFETY_ON_NULL_RETURN(ovl);
- if (ovl->clas_content) evas_object_del(ovl->clas_content);
+ evas_object_del(ovl->clas_content);
ovl->clas_content = _icon_dup(content, ovl->layout);
_overlay_default_layout_update(ovl);
}
if (ovl->icon == icon) return;
- if (ovl->icon) evas_object_del(ovl->icon);
+ evas_object_del(ovl->icon);
ovl->icon = icon;
_overlay_default_layout_update(ovl);
}
{
EINA_SAFETY_ON_NULL_RETURN(ovl);
- if (ovl->clas_icon) evas_object_del(ovl->clas_icon);
+ evas_object_del(ovl->clas_icon);
ovl->clas_icon = _icon_dup(icon, ovl->layout);
_overlay_default_layout_update(ovl);
}
{
EINA_SAFETY_ON_NULL_RETURN(ovl);
- if (ovl->content) evas_object_del(ovl->content);
- if (ovl->icon) evas_object_del(ovl->icon);
- if (ovl->clas_content) evas_object_del(ovl->clas_content);
- if (ovl->clas_icon) evas_object_del(ovl->clas_icon);
- if (ovl->layout) evas_object_del(ovl->layout);
+ evas_object_del(ovl->content);
+ evas_object_del(ovl->icon);
+ evas_object_del(ovl->clas_content);
+ evas_object_del(ovl->clas_icon);
+ evas_object_del(ovl->layout);
free(ovl);
}
EINA_SAFETY_ON_NULL_RETURN(ovl);
if (ovl->icon == icon) return;
- if (ovl->icon) evas_object_del(ovl->icon);
+ evas_object_del(ovl->icon);
ovl->icon = icon;
// For using proxy, it should have size and be shown but moved away to hide.
evas_object_resize(icon, 32, 32);
EINA_SAFETY_ON_NULL_RETURN(ovl);
if (ovl->content == content) return;
- if (ovl->content) evas_object_del(ovl->content);
+ evas_object_del(ovl->content);
ovl->content = content;
// For using proxy, it should have size and be shown but moved away to hide.
// content should have it's own size
_overlay_default_class_icon_update(overlay->ovl, NULL);
}
}
- if (clas->icon) evas_object_del(clas->icon);
- if (clas->members) eina_list_free(clas->members);
+ evas_object_del(clas->icon);
+ eina_list_free(clas->members);
free(clas);
}
return;
}
- if (sd->content) evas_object_del(sd->content);
+ evas_object_del(sd->content);
sd->content = content;
if (content)
item = (Elm_Menu_Item *)it;
if (content == item->content) return;
- if (item->content) evas_object_del(item->content);
-
+ evas_object_del(item->content);
item->content = content;
if (item->content)
elm_layout_content_set(VIEW(item), "elm.swallow.content", item->content);
evas_object_event_callback_del_full
(sd->bx, EVAS_CALLBACK_RESIZE, _menu_resize_cb, obj);
- if (sd->hv) evas_object_del(sd->hv);
- if (sd->location) evas_object_del(sd->location);
+ evas_object_del(sd->hv);
+ evas_object_del(sd->location);
eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
}
if (part && strcmp(part, "default")) return;
if (sd->content == content) goto end;
- if (sd->content) evas_object_del(sd->content);
+ evas_object_del(sd->content);
sd->content = content;
if (content)
free(g);
}
eo_unref(sd->pan_obj);
- evas_object_del(sd->pan_obj);
- sd->pan_obj = NULL;
+ ELM_SAFE_FREE(sd->pan_obj, evas_object_del);
if (sd->f) eina_file_close(sd->f);
free(sd->remote_data);
sd->do_gesture = gesture;
- if (sd->g_layer)
- {
- evas_object_del(sd->g_layer);
- sd->g_layer = NULL;
- }
+ ELM_SAFE_FREE(sd->g_layer, evas_object_del);
if (!gesture) return;
err:
EINA_LIST_FOREACH(page->items, l, it)
{
- if (it->w_obj) evas_object_del(it->w_obj);
- it->w_obj = NULL;
+ ELM_SAFE_FREE(it->w_obj, evas_object_del);
it->w_impl = NULL;
}
- if (page->w_obj) evas_object_del(page->w_obj);
- page->w_obj = NULL;
+ ELM_SAFE_FREE(page->w_obj, evas_object_del);
page->w_impl = NULL;
return EINA_FALSE;
it = evas_object_data_get(obj, "prefs_item");
lbl = evas_object_data_del(it->w_obj, "label_widget");
- if (lbl) evas_object_del(lbl);
+ evas_object_del(lbl);
icon = evas_object_data_del(it->w_obj, "icon_widget");
- if (icon) evas_object_del(icon);
+ evas_object_del(icon);
ELM_PREFS_DATA_GET(it->prefs, sd);
if (sd->content == content) return;
- if (sd->content) evas_object_del(sd->content);
+ evas_object_del(sd->content);
sd->content = content;
if (content)
{
if (content == item->icon) return;
- if (item->icon) evas_object_del(item->icon);
+ evas_object_del(item->icon);
item->icon = content;
if (!item->icon)
{
(sd->items_built, sd->items_built);
if (item->itc->func.del)
item->itc->func.del(elm_widget_item_data_get(item), VIEW(item));
- evas_object_del(VIEW(item));
- VIEW(item) = NULL;
+ ELM_SAFE_FREE(VIEW(item), evas_object_del);
}
}
evas = evas_object_evas_get(sd->obj);
if ((sd->view) && (sd->is_video ^ sd->was_video))
{
- evas_object_del(sd->view);
- sd->view = NULL;
+ ELM_SAFE_FREE(sd->view, evas_object_del);
}
sd->was_video = sd->is_video;
static void
_item_menu_destroy(Elm_Toolbar_Item *item)
{
- if (item->o_menu)
- {
- evas_object_del(item->o_menu);
- item->o_menu = NULL;
- }
+ ELM_SAFE_FREE(item->o_menu, evas_object_del);
item->menu = EINA_FALSE;
}
evas_object_del(it->icon);
}
- if (it->object) evas_object_del(it->object);
+ evas_object_del(it->object);
//TODO: See if checking for sd->menu_parent is necessary before
//deleting menu
- if (it->o_menu) evas_object_del(it->o_menu);
+ evas_object_del(it->o_menu);
}
static void
if (part && strcmp(part, "object")) return;
if (item->object == content) return;
- if (item->object) evas_object_del(item->object);
+ evas_object_del(item->object);
item->object = content;
if (item->object)
if (item->proxy)
{
evas_object_image_source_visible_set(elm_image_object_get(item->proxy), EINA_TRUE);
- evas_object_del(item->proxy);
- item->proxy = NULL;
+ ELM_SAFE_FREE(item->proxy, evas_object_del);
}
item->trans = NULL;
if (it->proxy)
{
evas_object_image_source_visible_set(elm_image_object_get(it->proxy), EINA_TRUE);
- evas_object_del(it->proxy);
- it->proxy = NULL;
+ ELM_SAFE_FREE(it->proxy, evas_object_del);
}
eo_do(obj, elm_scrollable_interface_hold_set(EINA_FALSE));
if (!_item_icon_set(icon_obj, "toolbar/", icon))
{
- evas_object_del(icon_obj);
- icon_obj = NULL;
+ ELM_SAFE_FREE(icon_obj, evas_object_del);
icon = NULL;
}
eina_stringshare_del(state->label);
eina_stringshare_del(state->icon_str);
- if (state->icon) evas_object_del(state->icon);
+ evas_object_del(state->icon);
free(state);
item->states = eina_list_remove_list(item->states, del_state);
if (item->del_func)
item->del_func((void *)item->data, item->widget, item);
- if (item->view)
- evas_object_del(item->view);
+ evas_object_del(item->view);
eina_stringshare_del(item->access_info);
eina_stringshare_del(sd->icon_name);
eina_stringshare_del(sd->role);
evas_object_del(sd->icon);
-
- if (sd->main_menu) evas_object_del(sd->main_menu);
+ evas_object_del(sd->main_menu);
_elm_win_profile_del(sd);
_elm_win_available_profiles_del(sd);
if (!elm_widget_theme_object_set
(sd->obj, sd->frame_obj, "border", "base", style))
{
- evas_object_del(sd->frame_obj);
- sd->frame_obj = NULL;
+ ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
return;
}
{
int w, h;
- if (sd->client_obj)
- {
- evas_object_del(sd->client_obj);
- sd->client_obj = NULL;
- }
+ ELM_SAFE_FREE(sd->client_obj, evas_object_del);
if (sd->frame_obj)
{
(sd->frame_obj, "elm,action,close", "elm",
_elm_win_frame_cb_close);
- evas_object_del(sd->frame_obj);
- sd->frame_obj = NULL;
+ ELM_SAFE_FREE(sd->frame_obj, evas_object_del);
}
evas_output_framespace_set(sd->evas, 0, 0, 0, 0);
tmp_sd.ee = ecore_evas_object_ecore_evas_get(tmp_sd.img_obj);
if (!tmp_sd.ee)
{
- evas_object_del(tmp_sd.img_obj);
- tmp_sd.img_obj = NULL;
+ ELM_SAFE_FREE(tmp_sd.img_obj, evas_object_del);
}
}
break;
if (!_elm_theme_object_set(obj, cur->obj, "cursor", cur->cursor_name,
cur->style ? cur->style : "default"))
{
- evas_object_del(cur->obj);
- cur->obj = NULL;
+ ELM_SAFE_FREE(cur->obj, evas_object_del);
return EINA_FALSE;
}
{
evas_object_event_callback_del_full(cur->obj, EVAS_CALLBACK_DEL,
_elm_cursor_obj_del, cur);
- evas_object_del(cur->obj);
- cur->obj = NULL;
+ ELM_SAFE_FREE(cur->obj, evas_object_del);
}
if (cur->visible)
{
ELM_CURSOR_GET_OR_RETURN(cur, obj);
cur->theme_search = theme_search;
- if (cur->obj)
- {
- evas_object_del(cur->obj);
- cur->obj = NULL;
- }
+ ELM_SAFE_FREE(cur->obj, evas_object_del);
_elm_cursor_cur_set(cur);
}
(tt->content, EVAS_CALLBACK_DEL,
_elm_tooltip_content_del_cb, tt);
evas_object_hide(tt->content);
- evas_object_del(tt->content);
- tt->content = NULL;
+ ELM_SAFE_FREE(tt->content, evas_object_del);
}
static void