Enlightenment CVS committal

Author  : tsauerbeck
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_x


Modified Files:
        ecore_x.c ecore_x_private.h ecore_x_selection.c 


Log Message:
memleak fixes
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- ecore_x.c   1 Feb 2004 11:00:41 -0000       1.25
+++ ecore_x.c   4 Feb 2004 17:43:41 -0000       1.26
@@ -422,6 +422,7 @@
    _ecore_x_filter_handler = NULL;
    _ecore_x_disp = NULL;
    _ecore_x_event_handlers = NULL;
+   _ecore_x_selection_shutdown();
    if (_ecore_x_init_count < 0) _ecore_x_init_count = 0;
    return _ecore_x_init_count;
 }
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_private.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- ecore_x_private.h   17 Jan 2004 00:14:37 -0000      1.18
+++ ecore_x_private.h   4 Feb 2004 17:43:41 -0000       1.19
@@ -183,6 +183,7 @@
 void _ecore_x_event_handle_shape_change(XEvent *xevent);
 
 void _ecore_x_selection_data_initialize(void);
+void _ecore_x_selection_shutdown(void);
 Atom _ecore_x_selection_target_atom_get(char *target);
 char * _ecore_x_selection_target_get(Atom target);
 void _ecore_x_selection_request_data_set(Ecore_X_Selection_Data data);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_selection.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ecore_x_selection.c 25 Jan 2004 03:17:09 -0000      1.9
+++ ecore_x_selection.c 4 Feb 2004 17:43:41 -0000       1.10
@@ -3,28 +3,40 @@
 #include <Ecore_X.h>
 #include <Ecore_Txt.h>
 
-/* FIXME: Initialize! */
-static Ecore_X_Selection_Data selections[3];
-static Ecore_X_Selection_Data request_data[3];
-static Ecore_X_Selection_Converter *converters;
+static Ecore_X_Selection_Data selections[3] = {{0}};
+static Ecore_X_Selection_Data request_data[3] = {{0}};
+static Ecore_X_Selection_Converter *converters = NULL;
 
 static int _ecore_x_selection_converter_text(char *target, void *data, int size, void 
**data_ret, int *size_ret);
 
 void
 _ecore_x_selection_data_initialize(void)
 {
-   memset(selections, 0, sizeof(selections));
-   memset(request_data, 0, sizeof(request_data));
-
    /* Initialize converters */
-   converters = NULL;
    ecore_x_selection_converter_atom_add(_ecore_x_atom_text, 
          _ecore_x_selection_converter_text);
    ecore_x_selection_converter_atom_add(_ecore_x_atom_compound_text,
          _ecore_x_selection_converter_text);
    ecore_x_selection_converter_atom_add(_ecore_x_atom_string,
          _ecore_x_selection_converter_text);
-   
+}
+
+void
+_ecore_x_selection_shutdown(void)
+{
+       Ecore_X_Selection_Converter *cnv = converters, *tmp;
+
+       if (!converters)
+               return;
+
+       /* free the selection converters */
+       while (cnv) {   
+               tmp = cnv->next;
+               free(cnv);
+               cnv = tmp;
+       }
+
+       converters = NULL;
 }
 
 static void




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to