[gtk/wip/chergert/gdk-macos-gl-renderer: 4/6] macos: be tolerant of NULL GL context
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/gdk-macos-gl-renderer: 4/6] macos: be tolerant of NULL GL context
- Date: Thu, 29 Oct 2020 17:51:18 +0000 (UTC)
commit ff582977a2d021b35d452278b355bb3fe1e976ff
Author: Christian Hergert <chergert redhat com>
Date: Thu Oct 29 09:46:02 2020 -0700
macos: be tolerant of NULL GL context
Some code appears to unconditionally attempt to make the context current,
so this makes things tolerant to a NULL GdkGLContext and just return FALSE.
gdk/macos/gdkmacosdisplay.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gdk/macos/gdkmacosdisplay.c b/gdk/macos/gdkmacosdisplay.c
index 6a89def8c1..665a567e70 100644
--- a/gdk/macos/gdkmacosdisplay.c
+++ b/gdk/macos/gdkmacosdisplay.c
@@ -649,7 +649,10 @@ gdk_macos_display_make_gl_context_current (GdkDisplay *display,
GdkGLContext *gl_context)
{
g_assert (GDK_IS_MACOS_DISPLAY (display));
- g_assert (GDK_IS_MACOS_GL_CONTEXT (gl_context));
+ g_assert (!gl_context || GDK_IS_MACOS_GL_CONTEXT (gl_context));
+
+ if (gl_context == NULL)
+ return FALSE;
return _gdk_macos_gl_context_make_current (GDK_MACOS_GL_CONTEXT (gl_context));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]