[cogl/cogl-1.20] winsys-glx: Add error traps in create_context
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl-1.20] winsys-glx: Add error traps in create_context
- Date: Tue, 28 Jul 2015 14:03:14 +0000 (UTC)
commit a63824a6579f8e926249723ed4c564eecad1ef78
Author: Adel Gadllah <adel gadllah gmail com>
Date: Sun Jul 26 11:27:00 2015 +0200
winsys-glx: Add error traps in create_context
Both create_gl3_context and glXCreateNewContext can fail with an X error.
https://bugzilla.gnome.org/show_bug.cgi?id=742678
Signed-off-by: Emmanuele Bassi <ebassi gnome org>
cogl/winsys/cogl-winsys-glx.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c
index 34fb071..122ecbb 100644
--- a/cogl/winsys/cogl-winsys-glx.c
+++ b/cogl/winsys/cogl-winsys-glx.c
@@ -1075,6 +1075,8 @@ create_context (CoglDisplay *display, CoglError **error)
COGL_NOTE (WINSYS, "Creating GLX Context (display: %p)",
xlib_renderer->xdpy);
+ _cogl_xlib_renderer_trap_errors (display->renderer, &old_state);
+
if (display->renderer->driver == COGL_DRIVER_GL3)
glx_display->glx_context = create_gl3_context (display, config);
else
@@ -1085,7 +1087,8 @@ create_context (CoglDisplay *display, CoglError **error)
NULL,
True);
- if (glx_display->glx_context == NULL)
+ if (_cogl_xlib_renderer_untrap_errors (display->renderer, &old_state) ||
+ glx_display->glx_context == NULL)
{
_cogl_set_error (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_CONTEXT,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]