summaryrefslogtreecommitdiff
path: root/src/cairo-gl-operand.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cairo-gl-operand.c')
-rw-r--r--src/cairo-gl-operand.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cairo-gl-operand.c b/src/cairo-gl-operand.c
index 575096a84..1d480d940 100644
--- a/src/cairo-gl-operand.c
+++ b/src/cairo-gl-operand.c
@@ -804,11 +804,17 @@ _cairo_gl_pattern_texture_setup (cairo_gl_operand_t *operand,
if (src_is_gl_surface) {
status = _cairo_gl_context_acquire (dst->base.device, &ctx);
if (unlikely (status))
+ {
+ _cairo_surface_unmap_image (&surface->base, image);
goto fail;
+ }
/* one more time acquire */
status = _cairo_gl_context_acquire (dst->base.device, &ctx);
if (unlikely (status))
+ {
+ _cairo_surface_unmap_image (&surface->base, image);
goto fail;
+ }
}
status = _cairo_surface_unmap_image (&surface->base, image);
@@ -833,7 +839,6 @@ _cairo_gl_pattern_texture_setup (cairo_gl_operand_t *operand,
fail:
cairo_surface_destroy (&surface->base);
- cairo_surface_destroy (image);
return status;
}