[cairo-commit] cairo/src cairo-image-surface.c, 1.35, 1.36 cairo-surface.c, 1.57, 1.58

Carl Worth commit at pdx.freedesktop.org
Wed Apr 13 14:52:01 PDT 2005


Committed by: cworth

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv22351/src

Modified Files:
	cairo-image-surface.c cairo-surface.c 
Log Message:

        * src/cairo-image-surface.c:
        (_cairo_image_abstract_surface_finish): Set freed pointer to NULL.

        * src/cairo-surface.c: (cairo_surface_finish): Fix to actually set
        surface->finished when done. Closes bug #2950 as documented in
        test/surface-finish-twice.c.

        * test/surface-finish-twice.c: Note that this bug is fixed.


Index: cairo-image-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-image-surface.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- cairo-image-surface.c	7 Apr 2005 21:25:00 -0000	1.35
+++ cairo-image-surface.c	13 Apr 2005 21:51:59 -0000	1.36
@@ -240,8 +240,10 @@
 {
     cairo_image_surface_t *surface = abstract_surface;
 
-    if (surface->pixman_image)
+    if (surface->pixman_image) {
 	pixman_image_destroy (surface->pixman_image);
+	surface->pixman_image = NULL;
+    }
 
     if (surface->owns_data) {
 	free (surface->data);

Index: cairo-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-surface.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- cairo-surface.c	12 Apr 2005 16:14:14 -0000	1.57
+++ cairo-surface.c	13 Apr 2005 21:51:59 -0000	1.58
@@ -168,11 +168,18 @@
 cairo_status_t
 cairo_surface_finish (cairo_surface_t *surface)
 {
+    cairo_status_t status;
+
     if (surface->finished)
 	return CAIRO_STATUS_SURFACE_FINISHED;
 
-    if (surface->backend->finish)
-	return surface->backend->finish (surface);
+    if (surface->backend->finish) {
+	status = surface->backend->finish (surface);
+	if (status)
+	    return status;
+    }
+
+    surface->finished = TRUE;
 
     return CAIRO_STATUS_SUCCESS;
 }




More information about the cairo-commit mailing list