commit a49c1b5498e8acc34ffaf21bee2169c458c62932
parent 70a2b10ce5ca4c072d66b4ea84591ad30166a59a
Author: Ricardo Mones <ricardo@mones.org>
Date: Fri, 14 Jun 2013 12:24:47 +0200
Deprecated gthread functions in newer glib
Since glib 2.32 these are deprecated:
• g_thread_init is not required anymore
• g_cond_new/g_cond_free → g_cond_init/g_cond_clear
Diffstat:
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/main.c b/src/main.c
@@ -1039,8 +1039,10 @@ int main(int argc, char *argv[])
if (cmd.exit)
return 0;
+#if !GLIB_CHECK_VERSION(2,32,0)
if (!g_thread_supported())
g_thread_init(NULL);
+#endif
reset_statistics();
diff --git a/src/prefs_account.c b/src/prefs_account.c
@@ -3367,7 +3367,11 @@ static gboolean sslcert_get_password(gpointer source, gpointer data)
{
struct GetPassData pass_data;
/* do complicated stuff to be able to call GTK from the mainloop */
+#if !GLIB_CHECK_VERSION(2,32,0)
pass_data.cond = g_cond_new();
+#else
+ g_cond_init(pass_data.cond);
+#endif
pass_data.mutex = cm_mutex_new();
pass_data.pass = (gchar **)source;
@@ -3376,7 +3380,11 @@ static gboolean sslcert_get_password(gpointer source, gpointer data)
g_idle_add(do_get_pass, &pass_data);
g_cond_wait(pass_data.cond, pass_data.mutex);
+#if !GLIB_CHECK_VERSION(2,32,0)
g_cond_free(pass_data.cond);
+#else
+ g_cond_clear(pass_data.cond);
+#endif
g_mutex_unlock(pass_data.mutex);
cm_mutex_free(pass_data.mutex);