summaryrefslogtreecommitdiff
path: root/gdk/x11/gdkglcontext-x11.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2015-03-25 15:18:44 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2015-03-25 15:18:44 +0000
commit85141bc503701b5e3a25fbb5a5982da4cadeec85 (patch)
treeb3cd92d8c4dc812e4d76ab7d880aa37eee5290a0 /gdk/x11/gdkglcontext-x11.c
parentb899a7838761eb52a39dca64534331b366dea582 (diff)
downloadgtk+-85141bc503701b5e3a25fbb5a5982da4cadeec85.tar.gz
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
Diffstat (limited to 'gdk/x11/gdkglcontext-x11.c')
-rw-r--r--gdk/x11/gdkglcontext-x11.c6
1 files changed, 6 insertions, 0 deletions
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",