[cairo-commit] src/cairo-quartz-surface.c

Brian Ewins brianewins at kemper.freedesktop.org
Thu May 24 15:50:32 PDT 2007


 src/cairo-quartz-surface.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletion(-)

New commits:
diff-tree fcdfda83655faf0eecbb2b5af09a05340fe422e6 (from 2c8598aafb4a8779ce94940ce91033a8c5a62ea4)
Author: Boris Zbarsky <bzbarsky at MIT.EDU>
Date:   Mon May 14 23:46:14 2007 -0500

    [quartz] implementing release_source_image (#11059)
    
    The image surface that _cairo_quartz_surface_acquire_source_image creates never
    seems to be released, probably because there is no release_source_image callback
    in the quartz code.
    
    The attached patch fixes that problem, at least insofar as the image surface
    itself is no longer leaking.  I'm not sure whether any other cleanup needs to
    happen here.
    
    -Boris

diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index 0c4414b..3a80908 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -869,6 +869,15 @@ _cairo_quartz_surface_acquire_source_ima
     return _cairo_quartz_get_image (surface, image_out, NULL);
 }
 
+static void
+_cairo_quartz_surface_release_source_image (void *abstract_surface,
+					     cairo_image_surface_t *image,
+					     void *image_extra)
+{
+    cairo_surface_destroy ((cairo_surface_t *) image);
+}
+
+
 static cairo_status_t
 _cairo_quartz_surface_acquire_dest_image (void *abstract_surface,
 					   cairo_rectangle_int16_t *interest_rect,
@@ -1442,7 +1451,7 @@ static const struct _cairo_surface_backe
     _cairo_quartz_surface_create_similar,
     _cairo_quartz_surface_finish,
     _cairo_quartz_surface_acquire_source_image,
-    NULL, /* release_source_image */
+    _cairo_quartz_surface_release_source_image,
     _cairo_quartz_surface_acquire_dest_image,
     _cairo_quartz_surface_release_dest_image,
     _cairo_quartz_surface_clone_similar,


More information about the cairo-commit mailing list