Deprecated gthread functions in newer glib
authorRicardo Mones <ricardo@mones.org>
Fri, 14 Jun 2013 10:24:47 +0000 (12:24 +0200)
committerRicardo Mones <ricardo@mones.org>
Fri, 14 Jun 2013 10:24:47 +0000 (12:24 +0200)
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

src/main.c
src/prefs_account.c

index f51b36f..451eac9 100644 (file)
@@ -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();
        
index b49ebea..32eeeed 100644 (file)
@@ -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);