[gtk/ebassi/issue-3948: 2/2] x11: Pair eglInitialize with eglTerminate




commit b3d6928f3593796e491ce4f28278184b6130c3c5
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu May 13 18:23:50 2021 +0100

    x11: Pair eglInitialize with eglTerminate
    
    If we bail out after EGL initialization we want to go back to a stable
    state and not leave EGL hanging.

 gdk/x11/gdkglcontext-egl.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gdk/x11/gdkglcontext-egl.c b/gdk/x11/gdkglcontext-egl.c
index cab476232f..08f4493a8b 100644
--- a/gdk/x11/gdkglcontext-egl.c
+++ b/gdk/x11/gdkglcontext-egl.c
@@ -596,7 +596,10 @@ gdk_x11_screen_init_egl (GdkX11Screen *screen)
    */
   const char *vendor = eglQueryString (edpy, EGL_VENDOR);
   if (strstr (vendor, "NVIDIA") != NULL)
-    return FALSE;
+    {
+      eglTerminate (edpy);
+      return FALSE;
+    }
 
   display_x11->have_egl = TRUE;
   display_x11->egl_version = epoxy_egl_version (dpy);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]