[gnome-games] Fix assertion failure on hildon



commit 9d50b44c227c2c3e6baf50be7a4f84f893ff20a8
Author: Christian Persch <chpe gnome org>
Date:   Tue Jun 2 00:29:37 2009 +0200

    Fix assertion failure on hildon
    
    g_parse_debug_string is only NULL-safe since glib 2.16 for bug #503862.
---
 libgames-support/games-debug.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/libgames-support/games-debug.c b/libgames-support/games-debug.c
index 51eab4b..46b60dc 100644
--- a/libgames-support/games-debug.c
+++ b/libgames-support/games-debug.c
@@ -37,9 +37,16 @@ _games_debug_init (void)
     { "sound",        GAMES_DEBUG_SOUND        },
     { "window-state", GAMES_DEBUG_WINDOW_STATE }
   };
+  const char *env;
 
-  _games_debug_flags = g_parse_debug_string (g_getenv ("GAMES_DEBUG"),
-                                             keys, G_N_ELEMENTS (keys));
+  env = g_getenv ("GAMES_DEBUG");
+
+#if !GLIB_CHECK_VERSION (2, 16, 0)
+  /* g_parse_debug_string is only NULL-safe since 2.16 */
+  if (env == NULL)
+    return;
+#endif
+
+  _games_debug_flags = g_parse_debug_string (env, keys, G_N_ELEMENTS (keys));
 #endif /* GNOME_ENABLE_DEBUG */
 }
-



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