Enlightenment CVS committal

Author  : doursse
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/modules/engines/software_xcb


Modified Files:
        Makefile.am evas_engine.c evas_engine.h evas_outbuf.c 


Log Message:
fix a leak in xcb eng sfw (it remains one, but I don't see where it comes 
from). Update the xrender one. Don't use them yet (but who uses them ??), 
because it relies on fix of xcb that are in my hd

===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_xcb/Makefile.am,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- Makefile.am 2 Mar 2006 09:16:46 -0000       1.5
+++ Makefile.am 23 Apr 2006 15:38:23 -0000      1.6
@@ -32,4 +32,4 @@
 evas_xcb_buffer.c \
 evas_xcb_color.c \
 evas_xcb_main.c \
-Evas_Engine_Software_Xcb.h
\ No newline at end of file
+Evas_Engine_Software_Xcb.h
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_xcb/evas_engine.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- evas_engine.c       10 Mar 2006 07:44:23 -0000      1.8
+++ evas_engine.c       23 Apr 2006 15:38:23 -0000      1.9
@@ -118,41 +118,16 @@
    return re;
 }
 
-static XCBSCREEN *
-_screen_get(XCBConnection *conn, int screen)
-{
-   XCBSCREENIter i;
-   int           cur;
-
-   if (!conn) return NULL;
-
-   i = XCBConnSetupSuccessRepRootsIter(XCBGetSetup(conn));
-   if (screen > i.rem - 1) return NULL; /* screen must be between 0 and i.rem 
- 1 */
-   for (cur = 0; cur <= screen; XCBSCREENNext(&i), ++cur);
-
-   return i.data;
-}
-
 static XCBVISUALTYPE *
 _best_visual_get(XCBConnection *conn, int screen)
 {
    XCBSCREEN        *scr;
-   XCBDEPTH         *d;
-   XCBVISUALTYPEIter iter;
-   int               cur;
 
    if (!conn) return NULL;
-   scr = _screen_get(conn, screen);
+   scr = XCBAuxGetScreen(conn, screen);
    if (!scr) return NULL;
-   d = XCBSCREENAllowedDepthsIter(scr).data;
-   if (!d) return NULL;
-
-   iter = XCBDEPTHVisualsIter(d);
-   for (cur = 0 ; cur < iter.rem ; XCBVISUALTYPENext(&iter), ++cur)
-      if (scr->root_visual.id == iter.data->visual_id.id)
-        return iter.data;
 
-   return NULL;
+   return XCBAuxGetVisualtype (conn, screen, scr->root_visual);
 }
 
 static XCBCOLORMAP
@@ -163,7 +138,7 @@
 
    c.xid = 0;
    if (!conn) return c;
-   scr = _screen_get(conn, screen);
+   scr = XCBAuxGetScreen(conn, screen);
    if (!scr) return c;
 
    return scr->default_colormap;
@@ -175,7 +150,7 @@
    XCBSCREEN *scr;
 
    if (!conn) return 0;
-   scr = _screen_get(conn, screen);
+   scr = XCBAuxGetScreen(conn, screen);
    if (!scr) return 0;
 
    return scr->root_depth;
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_xcb/evas_engine.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- evas_engine.h       10 Mar 2006 07:44:23 -0000      1.2
+++ evas_engine.h       23 Apr 2006 15:38:23 -0000      1.3
@@ -1,11 +1,13 @@
 #ifndef EVAS_ENGINE_H
 #define EVAS_ENGINE_H
 
+#include <sys/ipc.h>
+#include <sys/shm.h>
+
 #include <X11/XCB/xcb.h>
 #include <X11/XCB/shm.h>
+#include <X11/XCB/xcb_aux.h>
 #include <X11/XCB/xcb_image.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
 
 typedef struct _Outbuf                Outbuf;
 typedef struct _Outbuf_Perf           Outbuf_Perf;
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/modules/engines/software_xcb/evas_outbuf.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- evas_outbuf.c       15 Mar 2006 20:58:35 -0000      1.3
+++ evas_outbuf.c       23 Apr 2006 15:38:23 -0000      1.4
@@ -905,6 +905,8 @@
                                          strlen (type_str),
                                          type_str),
                            NULL);
+   if (!rep) return;
+
    type = rep->atom;
    format = STRING;
 
@@ -914,6 +916,7 @@
                     strlen(str), str);
 /*    XSync(perf->x.disp, False); */
    free(str);
+   free (rep);
 }
 
 Outbuf_Perf *
@@ -930,8 +933,6 @@
    char                *type_str;
    XCBATOM              type, format;
    Outbuf_Perf         *perf;
-   char                *retval;
-   int                  retnum;
 
    perf = evas_software_xcb_outbuf_perf_new_x(conn, draw, vis, cmap, x_depth);
 
@@ -944,31 +945,28 @@
                                 NULL);
    type = type_rep->atom;
    format = STRING;
-   retval = NULL;
 
    cookie = XCBGetProperty(conn, 0, perf->x.root.window,
                           type, format,
                           0, 16384);
    prop_rep = XCBGetPropertyReply(conn, cookie, NULL);
 
-   retval = XCBGetPropertyValue(prop_rep);
-   retnum = XCBGetPropertyValueLength(prop_rep);
-   if (retval)
+   if ((prop_rep) &&
+       (prop_rep->format == 8) &&
+       (prop_rep->type.xid == type.xid))
      {
-        if ((prop_rep->format == 8) &&
-           (prop_rep->type.xid == type.xid))
-       {
-          char *s;
-
-          s = malloc(retnum + 1);
-          strncpy(s, retval, retnum);
-          s[retnum] = 0;
-          evas_software_xcb_outbuf_perf_deserialize_x(perf, s);
-          free(s);
-       }
-       /* FIXME: doesn't seem to be need (from valgrind) */
-/*     free(retval); */
+        char *retval;
+        int retnum;
+
+        retval = XCBGetPropertyValue(prop_rep);
+        retnum = XCBGetPropertyValueLength(prop_rep);
+        retval[retnum] = '\0';
+        evas_software_xcb_outbuf_perf_deserialize_x(perf, retval);
      }
+
+   if (prop_rep)
+     free(prop_rep);
+
    return perf;
 }
 




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to