[cogl/wip/android: 8/12] winsys-egl: Check if there is a GError set before clearing it



commit c49c987f1cddd6aa78fdb74a359dd3040dfe57f0
Author: Damien Lespiau <damien lespiau intel com>
Date:   Mon May 16 16:04:33 2011 +0100

    winsys-egl: Check if there is a GError set before clearing it
    
    When try_create_context() returns saying that it can be run again to
    test create a context with an alternate configuration, it might not have
    a GError set (and it fact it does not right now). Thus right if
    try_create_context() has the set error before freeing it (you have an
    assertion from glib if error is NULL).

 cogl/winsys/cogl-winsys-egl.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c
index 133e127..7cd32d7 100644
--- a/cogl/winsys/cogl-winsys-egl.c
+++ b/cogl/winsys/cogl-winsys-egl.c
@@ -882,9 +882,12 @@ create_context (CoglDisplay *display, GError **error)
                                         &try_error)) &&
          try_fallback)
     {
-      g_error_free (try_error);
+      if (try_error)
+        {
+          g_error_free (try_error);
+          try_error = NULL;
+        }
       cleanup_context (display);
-      try_error = NULL;
       retry_cookie++;
     }
   if (!status)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]