From: Colin Leroy Date: Fri, 12 Oct 2012 10:29:00 +0000 (+0000) Subject: 2012-10-12 [colin] 3.8.1cvs93 X-Git-Tag: REL_3_9_0~31 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=36ebc83bd6cd4da9bd670ef39a3a6b1e04dbeba2 2012-10-12 [colin] 3.8.1cvs93 * src/compose.c * src/prefs_account.c * src/common/utils.c * src/common/utils.h Fix bug #2751 'g_mutex_new/g_mutex_free removed from GLib 2.32' Thanks to Salvatore de Paolis --- diff --git a/ChangeLog b/ChangeLog index 490a4edb0..7ef5159be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-10-12 [colin] 3.8.1cvs93 + + * src/compose.c + * src/prefs_account.c + * src/common/utils.c + * src/common/utils.h + Fix bug #2751 'g_mutex_new/g_mutex_free removed from GLib 2.32' + Thanks to Salvatore de Paolis + 2012-10-10 [colin] 3.8.1cvs92 * src/folder.c diff --git a/PATCHSETS b/PATCHSETS index 61f846c03..d0168e7c4 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -4467,3 +4467,4 @@ ( cvs diff -u -r 1.149.2.111 -r 1.149.2.112 src/inc.c; cvs diff -u -r 1.28.2.53 -r 1.28.2.54 src/mbox.c; cvs diff -u -r 1.11.2.32 -r 1.11.2.33 src/common/smtp.c; cvs diff -u -r 1.6.2.21 -r 1.6.2.22 src/common/smtp.h; ) > 3.8.1cvs90.patchset ( cvs diff -u -r 1.60.2.65 -r 1.60.2.66 src/procmsg.h; ) > 3.8.1cvs91.patchset ( cvs diff -u -r 1.213.2.215 -r 1.213.2.216 src/folder.c; cvs diff -u -r 1.1.2.116 -r 1.1.2.117 src/gtk/quicksearch.c; ) > 3.8.1cvs92.patchset +( cvs diff -u -r 1.382.2.615 -r 1.382.2.616 src/compose.c; cvs diff -u -r 1.105.2.177 -r 1.105.2.178 src/prefs_account.c; cvs diff -u -r 1.36.2.203 -r 1.36.2.204 src/common/utils.c; cvs diff -u -r 1.20.2.80 -r 1.20.2.81 src/common/utils.h; ) > 3.8.1cvs93.patchset diff --git a/configure.ac b/configure.ac index 98f8947dd..2d5fad6ab 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ MINOR_VERSION=8 MICRO_VERSION=1 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=92 +EXTRA_VERSION=93 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/common/utils.c b/src/common/utils.c index 46d3ebe79..7e11af26f 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -5308,3 +5308,23 @@ int claws_unlink(const gchar *filename) } return g_unlink(filename); } + +GMutex *cm_mutex_new(void) { +#if GLIB_CHECK_VERSION(2,32,0) + GMutex *m = mutex; + m = g_new0(GMutex, 1); + g_mutex_init(m); + return m; +#else + return g_mutex_new(); +#endif +} + +void cm_mutex_free(GMutex *mutex) { +#if GLIB_CHECK_VERSION(2,32,0) + g_mutex_clear(mutex); + g_free(m); +#else + g_mutex_free(mutex); +#endif +} diff --git a/src/common/utils.h b/src/common/utils.h index d78219996..e120c8a10 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -583,6 +583,10 @@ gboolean sc_g_list_bigger(GList *list, gint max); gboolean sc_g_slist_bigger(GSList *list, gint max); int claws_unlink(const gchar *filename); + +GMutex *cm_mutex_new(void); +void cm_mutex_free(GMutex *mutex); + #ifdef __cplusplus } #endif diff --git a/src/compose.c b/src/compose.c index f5eb082cf..186dd4ffe 100644 --- a/src/compose.c +++ b/src/compose.c @@ -7274,7 +7274,7 @@ static Compose *compose_create(PrefsAccount *account, compose->account = account; compose->folder = folder; - compose->mutex = g_mutex_new(); + compose->mutex = cm_mutex_new(); compose->set_cursor_pos = -1; #if !(GTK_CHECK_VERSION(2,12,0)) @@ -8607,7 +8607,7 @@ static void compose_destroy(Compose *compose) gtk_widget_destroy(compose->window); toolbar_destroy(compose->toolbar); g_free(compose->toolbar); - g_mutex_free(compose->mutex); + cm_mutex_free(compose->mutex); g_free(compose); } diff --git a/src/prefs_account.c b/src/prefs_account.c index 2f47c7232..4e2afefc6 100644 --- a/src/prefs_account.c +++ b/src/prefs_account.c @@ -3368,7 +3368,7 @@ 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 */ pass_data.cond = g_cond_new(); - pass_data.mutex = g_mutex_new(); + pass_data.mutex = cm_mutex_new(); pass_data.pass = (gchar **)source; g_mutex_lock(pass_data.mutex); @@ -3378,7 +3378,7 @@ static gboolean sslcert_get_password(gpointer source, gpointer data) g_cond_wait(pass_data.cond, pass_data.mutex); g_cond_free(pass_data.cond); g_mutex_unlock(pass_data.mutex); - g_mutex_free(pass_data.mutex); + cm_mutex_free(pass_data.mutex); return TRUE; }