diff options
author | Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> | 2010-02-12 18:41:23 +0000 |
---|---|---|
committer | Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> | 2010-02-12 19:26:07 +0000 |
commit | 0afec9f70bf205f05d75f08f7a2f0ddd2ba821ba (patch) | |
tree | 2b39eccc9ce367142b77a4969f6fb43f157b71e2 | |
parent | e5d921b41f216915d5b53097e269b2749842669f (diff) |
GThread init before any func call.
* removed g_thred_init from the log manager
* initialising thread in main, before anything else
-rw-r--r-- | src/telepathy-logger.c | 12 | ||||
-rw-r--r-- | telepathy-logger/log-manager.c | 13 |
2 files changed, 13 insertions, 12 deletions
diff --git a/src/telepathy-logger.c b/src/telepathy-logger.c index 7f3b832d1..e70bc3807 100644 --- a/src/telepathy-logger.c +++ b/src/telepathy-logger.c @@ -134,6 +134,18 @@ main (int argc, g_type_init (); + /* initialise thread support. It can be called just once, so check it already + * ON and call if if it's not. + * Threads are needed by Async APIs. + */ + if (!g_thread_supported ()) + { + DEBUG ("Initializing GThread"); + g_thread_init (NULL); + } + else + DEBUG ("GThread already initialized. Brilliant!"); + tp_debug_divert_messages (g_getenv ("TPL_LOGFILE")); #ifdef ENABLE_DEBUG diff --git a/telepathy-logger/log-manager.c b/telepathy-logger/log-manager.c index 5ac61e366..02db99c87 100644 --- a/telepathy-logger/log-manager.c +++ b/telepathy-logger/log-manager.c @@ -155,19 +155,8 @@ tpl_log_manager_init (TplLogManager *manager) { TplLogManagerPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (manager, TPL_TYPE_LOG_MANAGER, TplLogManagerPriv); - manager->priv = priv; - /* initialise thread support. It can be called just once, so check it already - * ON and call if if it's not. - * Threads are needed by Async APIs. - */ - if (!g_thread_supported ()) - { - DEBUG ("Initializing GThread"); - g_thread_init (NULL); - } - else - DEBUG ("GThread already initialized. Brilliant!"); + manager->priv = priv; } |