From 9f43f096b22a13f02d638b86b4460c7ed66d3c96 Mon Sep 17 00:00:00 2001 From: Henry Song Date: Sat, 1 Dec 2012 17:08:56 +0000 Subject: [PATCH] gl: Flush context upon evicting a gradient As the random selection of a gradient can possible destroy the currently active gradient, we need to flush the context in order to flush any references to the texture before deletion. --- src/cairo-gl-gradient.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cairo-gl-gradient.c b/src/cairo-gl-gradient.c index 1c1f97270..ac3292101 100644 --- a/src/cairo-gl-gradient.c +++ b/src/cairo-gl-gradient.c @@ -328,6 +328,8 @@ _cairo_gl_gradient_destroy (cairo_gl_gradient_t *gradient) return; if (_cairo_gl_context_acquire (gradient->device, &ctx) == CAIRO_STATUS_SUCCESS) { + /* The gradient my still be active in the last operation, so flush */ + _cairo_gl_composite_flush (ctx); glDeleteTextures (1, &gradient->tex); ignore = _cairo_gl_context_release (ctx, CAIRO_STATUS_SUCCESS); }