[cairo-commit] src/cairo-egl-context.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Dec 16 08:30:49 PST 2011

 src/cairo-egl-context.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 4c3276e94f1eb8b6cbe4069be3d1d89f00bbbc0d
Author: Pekka Paalanen <ppaalanen at gmail.com>
Date:   Fri Dec 16 16:27:40 2011 +0200

    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 at gmail.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-egl-context.c b/src/cairo-egl-context.c
index 00bfcbf..eb1ef29 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,
-    eglDestroySurface (ctx->display, ctx->dummy_surface);
+    if (ctx->dummy_surface != EGL_NO_SURFACE)
+        eglDestroySurface (ctx->display, ctx->dummy_surface);
 static cairo_bool_t

More information about the cairo-commit mailing list