Author: gnorton
Date: 2007-11-07 16:53:10 -0500 (Wed, 07 Nov 2007)
New Revision: 89169
Modified:
trunk/libgdiplus/src/ChangeLog
trunk/libgdiplus/src/graphics-private.h
trunk/libgdiplus/src/graphics.c
Log:
2007-11-07 Geoff Norton <[EMAIL PROTECTED]>
* graphics-private.h: Add CGImageRelease prototype.
* graphics.c: Free the CGImageRef after copying it to our display
context. Fixes a massive memory leak in the Mac backend
Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog 2007-11-07 21:48:13 UTC (rev 89168)
+++ trunk/libgdiplus/src/ChangeLog 2007-11-07 21:53:10 UTC (rev 89169)
@@ -1,3 +1,9 @@
+2007-11-07 Geoff Norton <[EMAIL PROTECTED]>
+
+ * graphics-private.h: Add CGImageRelease prototype.
+ * graphics.c: Free the CGImageRef after copying it to our display
+ context. Fixes a massive memory leak in the Mac backend
+
2007-11-01 Sebastien Pouliot <[EMAIL PROTECTED]>
* font.c: Fix font face selection (typo) and ensure the font-family
Modified: trunk/libgdiplus/src/graphics-private.h
===================================================================
--- trunk/libgdiplus/src/graphics-private.h 2007-11-07 21:48:13 UTC (rev
89168)
+++ trunk/libgdiplus/src/graphics-private.h 2007-11-07 21:53:10 UTC (rev
89169)
@@ -182,6 +182,7 @@
void *CGBitmapContextCreateImage (void *context);
void CGContextDrawImage (void *context, CGRect rect, void *image);
+void CGImageRelease (void *image);
void *cairo_quartz_surface_get_cg_context(cairo_surface_t *surface);
cairo_surface_t *cairo_quartz_surface_create (int format, int width, int
height);
cairo_surface_t *cairo_quartz_surface_create_for_cg_context (void *ctx, int
width, int height);
Modified: trunk/libgdiplus/src/graphics.c
===================================================================
--- trunk/libgdiplus/src/graphics.c 2007-11-07 21:48:13 UTC (rev 89168)
+++ trunk/libgdiplus/src/graphics.c 2007-11-07 21:53:10 UTC (rev 89169)
@@ -1813,7 +1813,9 @@
rect.origin.y = 0;
rect.size.width = graphics->bounds.Width;
rect.size.height = graphics->bounds.Height;
- CGContextDrawImage (graphics->cg_context, rect,
CGBitmapContextCreateImage (cairo_quartz_surface_get_cg_context (surface)));
+ void *image = CGBitmapContextCreateImage
(cairo_quartz_surface_get_cg_context (surface));
+ CGContextDrawImage (graphics->cg_context, rect, image);
+ CGImageRelease (image);
}
#endif
return Ok;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches