From 85141bc503701b5e3a25fbb5a5982da4cadeec85 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 25 Mar 2015 15:18:44 +0000 Subject: [PATCH] x11/gl: Do not try to call MakeCurrent with a NULL context This should not happen, but better safe than sorry. https://bugzilla.gnome.org/show_bug.cgi?id=746746 --- gdk/x11/gdkglcontext-x11.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c index f7763e3a0a..d9a49fdccb 100644 --- a/gdk/x11/gdkglcontext-x11.c +++ b/gdk/x11/gdkglcontext-x11.c @@ -1212,6 +1212,12 @@ gdk_x11_display_make_gl_context_current (GdkDisplay *display, } context_x11 = GDK_X11_GL_CONTEXT (context); + if (context_x11->glx_context == NULL) + { + g_critical ("No GLX context associated to the GdkGLContext; you must " + "call gdk_gl_context_realize() first."); + return FALSE; + } GDK_NOTE (OPENGL, g_print ("Making GLX context current to drawable %lu\n",