Enlightenment CVS committal

Author  : rephorm
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_widget_button.c 


Log Message:

don't leak when setting an icon on a button that already has one
don't leave stale subobjects when setting a button's icon to NULL

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_widget_button.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- e_widget_button.c   28 Feb 2007 02:58:40 -0000      1.14
+++ e_widget_button.c   28 Mar 2007 05:50:43 -0000      1.15
@@ -86,15 +86,17 @@
    E_Widget_Data *wd;
 
    wd = e_widget_data_get(obj);
-   if (!icon)
+   if (wd->o_icon)
      {
+       e_widget_sub_object_del(obj, wd->o_icon);
        evas_object_hide(wd->o_icon);
        edje_object_signal_emit(wd->o_button, "e,action,hide,icon", "e");
        edje_object_message_signal_process(wd->o_button);
        edje_object_part_unswallow(wd->o_button, wd->o_icon);
        evas_object_del(wd->o_icon);
+       wd->o_icon = NULL;
      }
-   else
+   if (icon)
      {
        wd->o_icon = icon;
        edje_object_part_swallow(wd->o_button, "e.swallow.icon", icon);



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to