[cairo] [PATCH] gl: release context if creating image failed

Henry (Yu) Song - SISA hsong at sisa.samsung.com
Fri Jun 15 07:36:16 PDT 2012


Hi, Yuanhan

I will, Thanks

Henry
________________________________________
From: cairo-bounces+hsong=sisa.samsung.com at cairographics.org [cairo-bounces+hsong=sisa.samsung.com at cairographics.org] on behalf of Yuanhan Liu [yuanhan.liu at linux.intel.com]
Sent: Thursday, June 14, 2012 11:01 PM
To: Petr Kobalíček; Henry Song
Cc: cairo at cairographics.org
Subject: Re: [cairo] [PATCH] gl: release context if creating image failed

On Thu, Jun 14, 2012 at 05:43:57PM +0300, Petr Kobalíček wrote:
> Hi,
>
> aren't you accessing image->status after destroying the image?

Yes, since image->status stored the 'real error' we met while creating
image. Thus, that's the error we should report.


And oops, I just found this patch is against with Henry's tree.

Henry, would you pick this minor fix?

Thanks,
Yuanhan Liu
>
> On Wed, Jun 13, 2012 at 12:55 PM, Yuanhan Liu
> <yuanhan.liu at linux.intel.com> wrote:
> > Release gl context if the former image creating failed. Also let it
> > return the right status value from image->status
> >
> > Signed-off-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
> > ---
> >  src/cairo-gl-operand.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/src/cairo-gl-operand.c b/src/cairo-gl-operand.c
> > index 1368a86..bb341ab 100644
> > --- a/src/cairo-gl-operand.c
> > +++ b/src/cairo-gl-operand.c
> > @@ -589,7 +589,9 @@ _cairo_gl_pattern_texture_setup (cairo_gl_operand_t *operand,
> >                                                        extents->height,
> >                                                        -1);
> >     if (unlikely (image->status)) {
> > +       cairo_int_status_t ignore = _cairo_gl_context_release(ctx, status);
> >        cairo_surface_destroy (image);
> > +       status = image->status;
> >        goto fail;
> >     }
> >
> > --
> > 1.7.7.6
> >
> > --
> > cairo mailing list
> > cairo at cairographics.org
> > http://lists.cairographics.org/mailman/listinfo/cairo
--
cairo mailing list
cairo at cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo


More information about the cairo mailing list