Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_label.c ewl_widget.c ewl_widget.h 


Log Message:
- fix memleak

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_label.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- ewl_label.c 6 Feb 2007 13:42:17 -0000       1.22
+++ ewl_label.c 7 Mar 2007 00:02:43 -0000       1.23
@@ -76,7 +76,8 @@
 /**
  * @param la: The Ewl_Label to get the text from
  * @return Returns no value.
- * @brief Gets the current text set into the label
+ * @brief Gets the current text set into the label. Note, this pointer will
+ * only be valid until the next time ewl_label_text_set() is called.
  */
 const char *
 ewl_label_text_get(Ewl_Label *la)
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_widget.c,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -3 -r1.130 -r1.131
--- ewl_widget.c        5 Mar 2007 13:50:33 -0000       1.130
+++ ewl_widget.c        7 Mar 2007 00:02:43 -0000       1.131
@@ -1026,8 +1026,11 @@
  * Get the text of a given Edje-define TEXT part.  This is for
  * widgets whose Edje appearance defines TEXT parts, and enables
  * each of those text parts to be retrieved independently.
+ *
+ * The returned string will only be valid until the next time text is set on
+ * this part.
  */
-char *
+const char *
 ewl_widget_appearance_part_text_get(Ewl_Widget *w, const char *part)
 {
        int i;
@@ -1061,7 +1064,7 @@
                }
        }
 
-       DRETURN_PTR((match ? strdup(match->value) : NULL), DLEVEL_STABLE);
+       DRETURN_PTR((match ? match->value : NULL), DLEVEL_STABLE);
 }
 
 /**
@@ -1092,8 +1095,11 @@
  * @param w: the widget whose text to retrieve
  * @return Returns the current text on success, NULL on failure.
  * @brief Retrieve the text of the given theme part of a widget
+ * 
+ * Note, the returned value will only be valid until the next time
+ * ewl_widget_appearance_text_set() is called on this widget.
  */
-char *
+const char *
 ewl_widget_appearance_text_get(Ewl_Widget *w)
 {
        const char *part;
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_widget.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -3 -r1.59 -r1.60
--- ewl_widget.h        4 Mar 2007 00:52:01 -0000       1.59
+++ ewl_widget.h        7 Mar 2007 00:02:43 -0000       1.60
@@ -192,9 +192,9 @@
                                                int size);
 void            ewl_widget_appearance_part_text_set(Ewl_Widget *w, const char 
*part,
                                                   const char *text);     
-char           *ewl_widget_appearance_part_text_get(Ewl_Widget *w, const char 
*part);
+const char     *ewl_widget_appearance_part_text_get(Ewl_Widget *w, const char 
*part);
 void            ewl_widget_appearance_text_set(Ewl_Widget *w, const char 
*text);
-char           *ewl_widget_appearance_text_get(Ewl_Widget *w);
+const char     *ewl_widget_appearance_text_get(Ewl_Widget *w);
 
 void            ewl_widget_inherit(Ewl_Widget *widget, const char *type);
 



-------------------------------------------------------------------------
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