Commit d207aa0e authored by Dom Lachowicz's avatar Dom Lachowicz

fix major memleak

parent f597c0a9
......@@ -2,6 +2,7 @@
* configure.in: Prioritize the cairo backend over the libart one; disable the libart backend until it builds again
* Makefile.am: Ditto
* rsvg-cairo-draw.c (rsvg_cairo_generate_mask): Fix major memleak generating a mask surface
2005-10-20 Caleb Moore <c.moore@student.unsw.edu.au>
......
......@@ -620,8 +620,9 @@ void rsvg_cairo_render_image (RsvgDrawingCtx *ctx, const GdkPixbuf * pixbuf,
cairo_restore (render->cr);
}
static cairo_surface_t *
rsvg_cairo_generate_mask(RsvgMask * self, RsvgDrawingCtx *ctx,
static void
rsvg_cairo_generate_mask(cairo_t *cr,
RsvgMask * self, RsvgDrawingCtx *ctx,
RsvgBbox * bbox)
{
cairo_surface_t *surface;
......@@ -693,7 +694,10 @@ rsvg_cairo_generate_mask(RsvgMask * self, RsvgDrawingCtx *ctx,
}
cairo_destroy (mask_cr);
return surface;
cairo_mask_surface (cr, surface, 0,0);
cairo_surface_destroy(surface);
g_free(pixels);
}
static void
......@@ -866,10 +870,7 @@ rsvg_cairo_pop_render_stack (RsvgDrawingCtx *ctx)
&render->bbox);
if (state->mask)
{
cairo_surface_t * mask =
rsvg_cairo_generate_mask(state->mask, ctx, &render->bbox);
cairo_mask_surface (render->cr, mask, 0,0);
cairo_surface_destroy(mask);
rsvg_cairo_generate_mask(render->cr, state->mask, ctx, &render->bbox);
}
else if (state->opacity != 0xFF)
cairo_paint_with_alpha (render->cr, (double)state->opacity / 255.0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment