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

Yuanhan Liu yuanhan.liu at linux.intel.com
Wed Jun 13 02:55:33 PDT 2012


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



More information about the cairo mailing list