Enlightenment CVS committal

Author  : zuluone
Project : misc
Module  : erss

Dir     : misc/erss/src


Modified Files:
        config.h erss.c gui.c ls.c net.c parse_config.c tooltip.c 
        tooltip.h 


Log Message:
fixed memory leak I think, but hard to tell as it dies so frequently
===================================================================
RCS file: /cvsroot/enlightenment/misc/erss/src/config.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- config.h    21 Feb 2004 08:53:36 -0000      1.1
+++ config.h    9 Mar 2004 17:51:45 -0000       1.2
@@ -9,10 +9,10 @@
 /* #undef HAVE_LIBSM */
 /* #undef HAVE_PAM */
 /* #undef PACKAGE_LOCALE_DIR */
-#define PACKAGE_DATA_DIR "/usr/share/erss"
-#define PACKAGE_SOURCE_DIR "/usr/src/app/misc/erss"
-#define PACKAGE_CFG_DIR "/usr/etc"
-#define PREFIX "/usr"
+#define PACKAGE_DATA_DIR "/usr/local/share/erss"
+#define PACKAGE_SOURCE_DIR "/home/z1/e17misc/erss"
+#define PACKAGE_CFG_DIR "/usr/local/etc"
+#define PREFIX "/usr/local/"
 /* #undef ENTRANCE_XSESSION */
 /* #undef HAVE_ECORE_GL_X11 */
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/erss/src/erss.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- erss.c      26 Feb 2004 21:05:32 -0000      1.39
+++ erss.c      9 Mar 2004 17:51:46 -0000       1.40
@@ -47,11 +47,12 @@
        curtime = time(NULL);
        ts = localtime(&curtime);
 
-       str = malloc (11);
+       str = malloc (9*sizeof(char));
 
-       snprintf (str, 20, "%02d:%02d:%02d", 
+       snprintf (str, 9, "%02d:%02d:%02d", 
                        ts->tm_hour, ts->tm_min, ts->tm_sec);
 
+       /*free(ts);*/
        return str;
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/erss/src/gui.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- gui.c       26 Feb 2004 21:05:32 -0000      1.3
+++ gui.c       9 Mar 2004 17:51:46 -0000       1.4
@@ -29,16 +29,19 @@
 int erss_set_time (void *data)
 {
        Erss_Feed *f=(Erss_Feed *)data;
-       char      *str;
+       /* these commented out bits stopped being used when we stopped showing
+        * the clock in the window - left in case they are ever wanted again
+        */
+       /* char      *str; */
        char       text[100];
 
-       str = erss_time_format ();
+       /* str = erss_time_format (); */
        if (f->last_time)
                snprintf (text, sizeof (text), "Last update: %s", f->last_time);
 
        edje_object_part_text_set (tid, "clock", text);
 
-       free (str);
+       /* free (str); */
 
        return TRUE;
 }
@@ -220,8 +223,11 @@
                return FALSE;
 
        item = ewd_list_goto_first (list);
-       while ((item = ewd_list_next(list)))
+       while ((item = ewd_list_next(list))) {
+               if (item->description && item->obj)
+                       erss_tooltip_free(item);
                erss_gui_item_dst(&item);
+       }
 
        ewd_list_remove (list);
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/erss/src/ls.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ls.c        21 Feb 2004 08:53:36 -0000      1.1
+++ ls.c        9 Mar 2004 17:51:46 -0000       1.2
@@ -90,8 +90,8 @@
        }
 
        /*
-        * Finished reading and printing avaliable config files
-        * now remove the paths list since we don't need it anyumore.
+        * Finished reading and printing available config files
+        * now remove the paths list since we don't need it anymore.
         */
        ptr = ewd_list_goto_first (paths);
        while ((ptr = ewd_list_current (paths))) {
===================================================================
RCS file: /cvsroot/enlightenment/misc/erss/src/net.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- net.c       26 Feb 2004 21:05:32 -0000      1.5
+++ net.c       9 Mar 2004 17:51:46 -0000       1.6
@@ -40,7 +40,7 @@
                fprintf (stderr, "%s error: Could not connect to server ..\n", 
PACKAGE);
        else {
                f->total_connects++;
-               f->last_time = strdup (erss_time_format ());
+               f->last_time = erss_time_format ();
                erss_set_time (f);
        }
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/erss/src/parse_config.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- parse_config.c      26 Feb 2004 21:05:32 -0000      1.6
+++ parse_config.c      9 Mar 2004 17:51:46 -0000       1.7
@@ -1,5 +1,5 @@
-#include "erss.h"
-#include "parse_config.h"      /* Erss_Config, Erss_Rc_Config  */
+#include "erss.h"              /* Erss_Config */
+#include "parse_config.h"      /* Erss_Rc_Config  */
 #include "ls.h"                /* erss_list_config_files() */
 
 Erss_Rc_Config *rc = NULL;
===================================================================
RCS file: /cvsroot/enlightenment/misc/erss/src/tooltip.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- tooltip.c   26 Feb 2004 19:20:59 -0000      1.9
+++ tooltip.c   9 Mar 2004 17:51:46 -0000       1.10
@@ -168,3 +168,28 @@
     }
     return FALSE;
 }
+
+void erss_tooltip_free(Erss_Article *item) {
+    Erss_Tooltip *tt;
+
+    /* get rid of our callbacks */
+    evas_object_event_callback_del (item->obj,
+                                   EVAS_CALLBACK_MOUSE_IN, erss_tooltip_mouse_in);
+    tt = evas_object_event_callback_del (item->obj,
+                                   EVAS_CALLBACK_MOUSE_OUT, erss_tooltip_mouse_out);
+    if (tt==NULL) {
+       fprintf(stderr,"%s error: trying to free non-existent tooltip\n", PACKAGE);
+       return;
+    }
+    evas_object_event_callback_del (tt->etox,
+                                   EVAS_CALLBACK_MOUSE_UP, 
erss_tooltip_mouse_clicked);
+    evas_object_event_callback_del (tt->bg,
+                                   EVAS_CALLBACK_MOUSE_UP, 
erss_tooltip_mouse_clicked);
+
+    /* then lose the ecore_evas */
+    ecore_evas_free(tt->ee);
+    ecore_x_window_del(tt->win);
+    /* finally free the damn thing */
+    memset(tt,0,sizeof(Erss_Tooltip));
+    free(tt);
+}
===================================================================
RCS file: /cvsroot/enlightenment/misc/erss/src/tooltip.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- tooltip.h   21 Feb 2004 11:12:18 -0000      1.2
+++ tooltip.h   9 Mar 2004 17:51:46 -0000       1.3
@@ -1 +1,2 @@
 int erss_tooltip_for(Erss_Article *item);
+void erss_tooltip_free(Erss_Article *item);




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to