cleanup frame icon upon failing to use it

This commit is contained in:
Mike Blumenkrantz 2014-01-21 09:31:30 -05:00
parent 9b4b003c40
commit d2f9a2efbf
1 changed files with 9 additions and 3 deletions

View File

@ -2535,10 +2535,13 @@ e_comp_object_frame_icon_update(Evas_Object *obj)
{ {
API_ENTRY; API_ENTRY;
evas_object_del(cw->frame_icon); E_FREE_FUNC(cw->frame_icon, evas_object_del);
if (!edje_object_part_exists(cw->frame_object, "e.swallow.icon"))
return;
cw->frame_icon = e_client_icon_add(cw->ec, cw->comp->evas); cw->frame_icon = e_client_icon_add(cw->ec, cw->comp->evas);
if (!cw->frame_icon) return; if (!cw->frame_icon) return;
edje_object_part_swallow(cw->frame_object, "e.swallow.icon", cw->frame_icon); if (!edje_object_part_swallow(cw->frame_object, "e.swallow.icon", cw->frame_icon))
E_FREE_FUNC(cw->frame_icon, evas_object_del);
} }
EAPI Eina_Bool EAPI Eina_Bool
@ -2619,7 +2622,10 @@ e_comp_object_frame_theme_set(Evas_Object *obj, const char *name)
if (pbg) if (pbg)
{ {
if (cw->frame_icon) if (cw->frame_icon)
edje_object_part_swallow(cw->frame_object, "e.swallow.icon", cw->frame_icon); {
if (!edje_object_part_swallow(cw->frame_object, "e.swallow.icon", cw->frame_icon))
E_FREE_FUNC(cw->frame_icon, evas_object_del);
}
} }
else if (cw->ec) else if (cw->ec)
{ {