[telepathy-gabble/master] move g_thread_init() call to gabble_main

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Wed Jul 22 09:03:15 PDT 2009


g_thread_init has to be called before any glib function
---
 src/gabble.c         |    5 +++++
 src/jingle-factory.c |    5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gabble.c b/src/gabble.c
index 8b1f461..576b58a 100644
--- a/src/gabble.c
+++ b/src/gabble.c
@@ -127,6 +127,11 @@ int
 gabble_main (int argc,
     char **argv)
 {
+  /* libsoup uses glib in multiple threads and don't have this, so we have to
+   * enable it manually here */
+  if (!g_thread_supported ())
+    g_thread_init (NULL);
+
   tp_debug_divert_messages (g_getenv ("GABBLE_LOGFILE"));
 
 #ifdef ENABLE_DEBUG
diff --git a/src/jingle-factory.c b/src/jingle-factory.c
index 2837f27..418ff15 100644
--- a/src/jingle-factory.c
+++ b/src/jingle-factory.c
@@ -1203,11 +1203,6 @@ gabble_jingle_factory_create_google_relay_session (
 
   if (priv->soup == NULL)
     {
-      /* libsoup uses glib in multiple threads and don't have this, so we have to
-       * enable it manually here */
-      if (!g_thread_supported ())
-        g_thread_init (NULL);
-
       priv->soup = soup_session_async_new ();
 
       /* If we don't get answer in a few seconds, relay won't do
-- 
1.5.6.5




More information about the telepathy-commits mailing list