From d7153dc8cd6686b6b90a05bc6797bca222b522f0 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Orsini Date: Sun, 22 Jan 2012 15:23:57 +0000 Subject: [PATCH] not calling g_thread_init when compiled with glib >= 2.32 --- NEWS | 1 + src/main.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/NEWS b/NEWS index 15c4e4b..ed814d0 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ * v0.7.0.0 ** psensor: fixed sensor type displayed in sensor preferences dialog. +** psensor: not calling g_thread_init when compiled with glib >= 2.32. ** psensor: added basic instruction in the README for compiling psensor with the ATI/AMD GPU support. ** psensor: fixed compilation error on 64bits with ATI/AMD GPU support. diff --git a/src/main.c b/src/main.c index 3784135..85f38a4 100644 --- a/src/main.c +++ b/src/main.c @@ -376,6 +376,20 @@ static gboolean initial_window_show(gpointer data) return FALSE; } +static void log_glib_info() +{ + log_debug("Compiled with GLib %d.%d.%d", + GLIB_MAJOR_VERSION, + GLIB_MINOR_VERSION, + GLIB_MICRO_VERSION); + + log_debug("Running with GLib %d.%d.%d", + glib_major_version, + glib_minor_version, + glib_micro_version); +} + + int main(int argc, char **argv) { struct ui_psensor ui; @@ -425,7 +439,17 @@ int main(int argc, char **argv) log_init(); + log_glib_info(); +#if !(GLIB_CHECK_VERSION(2, 32, 0)) + /* + * Since GLib 2.3.32 g_thread_init call is deprecated and not + * needed. Documentation of this method is not clear whether + * it is also useless with 2.3.31. + */ + log_debug("Calling g_thread_init(NULL)"); g_thread_init(NULL); +#endif + gdk_threads_init(); gtk_init(NULL, NULL); -- 2.7.4