[gtk+] x11/gl: Do not try to call MakeCurrent with a NULL context
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] x11/gl: Do not try to call MakeCurrent with a NULL context
- Date: Wed, 25 Mar 2015 17:04:00 +0000 (UTC)
commit 85141bc503701b5e3a25fbb5a5982da4cadeec85
Author: Emmanuele Bassi <ebassi gnome org>
Date: Wed Mar 25 15:18:44 2015 +0000
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 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index f7763e3..d9a49fd 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",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]