discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=d2f9a2efbf826f4e16c26bd6a2ea5c6e3be031ef

commit d2f9a2efbf826f4e16c26bd6a2ea5c6e3be031ef
Author: Mike Blumenkrantz <zm...@samsung.com>
Date:   Tue Jan 21 09:31:30 2014 -0500

    cleanup frame icon upon failing to use it
---
 src/bin/e_comp_object.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c
index ae9ce9e..24bf67b 100644
--- a/src/bin/e_comp_object.c
+++ b/src/bin/e_comp_object.c
@@ -2535,10 +2535,13 @@ e_comp_object_frame_icon_update(Evas_Object *obj)
 {
    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);
    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
@@ -2619,7 +2622,10 @@ e_comp_object_frame_theme_set(Evas_Object *obj, const 
char *name)
         if (pbg)
           {
              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)
           {

-- 


Reply via email to