[gnome-games/gsoc-seed-games] [libgames-support] Only call g_thread_init if it hasn't already been called



commit 585fddad16f9f3345c643a1f5724866ec5788373
Author: Tim Horton <hortont svn gnome org>
Date:   Fri Jun 12 18:55:01 2009 -0400

    [libgames-support] Only call g_thread_init if it hasn't already been called
    
    In the case of Seed games, for example, the Seed runtime has already
    called g_thread_init before it's possible to call games_runtime_init.

 libgames-support/games-runtime.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/libgames-support/games-runtime.c b/libgames-support/games-runtime.c
index 677535e..1dc2d90 100644
--- a/libgames-support/games-runtime.c
+++ b/libgames-support/games-runtime.c
@@ -93,7 +93,9 @@ games_runtime_init (const char *name)
   /* If we're going to use gconf, gnome-vfs, or canberra, we need to
    * init threads; and this has to be done before calling any other glib functions.
    */
-  g_thread_init (NULL);
+  if(!g_thread_get_initialized()) {
+    g_thread_init (NULL);
+  }
   /* May call any glib function after this point */
 #endif
 



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