summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <ppaalanen@gmail.com>2011-12-16 16:27:40 +0200
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-16 16:30:12 +0000
commit4c3276e94f1eb8b6cbe4069be3d1d89f00bbbc0d (patch)
treef4fd6b964d970710c3e9e8b00d97728a30ea333a
parentb845a191d55bb8ed07acdd06cbf3e47b3b7dd202 (diff)
egl: do not destroy dummy_surface if it does not exist
On deleting an EGL device, it is possible that cairo_egl_context_t::dummy_surface is EGL_NO_SURFACE. In that case calling eglDestroySurface() on it will lead to EGL_BAD_SURFACE error. Check dummy_surface before destroying it. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/cairo-egl-context.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cairo-egl-context.c b/src/cairo-egl-context.c
index 00bfcbf9..eb1ef296 100644
--- a/src/cairo-egl-context.c
+++ b/src/cairo-egl-context.c
@@ -112,7 +112,8 @@ _egl_destroy (void *abstract_ctx)
eglMakeCurrent (ctx->display,
EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
- eglDestroySurface (ctx->display, ctx->dummy_surface);
+ if (ctx->dummy_surface != EGL_NO_SURFACE)
+ eglDestroySurface (ctx->display, ctx->dummy_surface);
}
static cairo_bool_t