From d20af8338a6b8100f43b5ac66daa0d5e5f8abca9 Mon Sep 17 00:00:00 2001 From: Matthieu Bouron Date: Fri, 17 Apr 2015 14:24:28 +0200 Subject: [PATCH] glcontext: Make gst_gl_context_egl_activate fail if the old surface could not be destroyed https://bugzilla.gnome.org/show_bug.cgi?id=746251 --- gst-libs/gst/gl/egl/gstglcontext_egl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/gl/egl/gstglcontext_egl.c b/gst-libs/gst/gl/egl/gstglcontext_egl.c index 4779d32d3b..8a6468ce60 100644 --- a/gst-libs/gst/gl/egl/gstglcontext_egl.c +++ b/gst-libs/gst/gl/egl/gstglcontext_egl.c @@ -523,8 +523,13 @@ gst_gl_context_egl_activate (GstGLContext * context, gboolean activate) "Handle changed (have:%p, now:%p), switching surface", (void *) egl->window_handle, (void *) handle); if (egl->egl_surface) { - eglDestroySurface (egl->egl_display, egl->egl_surface); + result = eglDestroySurface (egl->egl_display, egl->egl_surface); egl->egl_surface = EGL_NO_SURFACE; + if (!result) { + GST_ERROR_OBJECT (context, "Failed to destroy old window surface: %s", + gst_gl_context_egl_get_error_string ()); + goto done; + } } egl->egl_surface = eglCreateWindowSurface (egl->egl_display, egl->egl_config, handle,