[cairo] [patch] subsurface: fix memory leak

Henry (Yu) Song - SISA hsong at sisa.samsung.com
Thu Jun 14 14:43:50 PDT 2012


Hi, Chris

OK, I am reluctant to do this, but that is the only option?

commit 43fef9e03a453eecaf6fd5a83674de8928fc0d73
Author: Henry Song <henry.song at samsung.com>
Date:   Thu Jun 14 14:24:35 2012 -0700

    gl: we do not set snapshot of a subsurface, this causes a memory leak.
    Instead, we roll our own dice

diff --git a/src/cairo-gl-operand.c b/src/cairo-gl-operand.c
index 4ef3307..d723e07 100644
--- a/src/cairo-gl-operand.c
+++ b/src/cairo-gl-operand.c
@@ -157,7 +157,9 @@ _cairo_gl_subsurface_clone_operand_init (cairo_gl_operand_t *operand,
 	    return status;
 	}
 
-	_cairo_surface_subsurface_set_snapshot (&sub->base, &surface->base);
     }
 
     status = _resolve_multisampling (surface);


________________________________________
From: Chris Wilson [chris at chris-wilson.co.uk]
Sent: Thursday, June 14, 2012 2:39 PM
To: Henry (Yu) Song - SISA; cairo at cairographics.org
Subject: RE: [cairo] [patch] subsurface: fix memory leak

On Thu, 14 Jun 2012 21:28:09 +0000, "Henry (Yu) Song - SISA" <hsong at sisa.samsung.com> wrote:
> Hi, Chris
>
> How about this
>
> commit 43fef9e03a453eecaf6fd5a83674de8928fc0d73
> Author: Henry Song <henry.song at samsung.com>
> Date:   Thu Jun 14 14:24:35 2012 -0700
>
>     gl: we do not set snapshot of a subsurface, this causes a memory leak.
>     Instead, we roll our own dice

No, it fails to discard the cache if the target surface is updated, so
you end up using a stale copy.
-Chris

--
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list