2012-10-12 [colin] 3.8.1cvs93
authorColin Leroy <colin@colino.net>
Fri, 12 Oct 2012 10:29:00 +0000 (10:29 +0000)
committerColin Leroy <colin@colino.net>
Fri, 12 Oct 2012 10:29:00 +0000 (10:29 +0000)
* 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

ChangeLog
PATCHSETS
configure.ac
src/common/utils.c
src/common/utils.h
src/compose.c
src/prefs_account.c

index 490a4edb0c3e6bffcd0e49bffe49542f1017055b..7ef5159be16226ba5b81340207b7418431eb3872 100644 (file)
--- 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
index 61f846c03e67c7a374de605d4a8480d85aab4db8..d0168e7c4678fc87273c20ec10319e3863e42902 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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
index 98f8947dd965efd5c3b9bca6bc80b1cea5421ce1..2d5fad6ab7096c0404ca9ce4d31f7237017a5571 100644 (file)
@@ -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=
 
index 46d3ebe7913a27fe7c7203ba067ca99f49a0172b..7e11af26ffb68015f7f7ddbe73fdf9cfc6175bd4 100644 (file)
@@ -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
+}
index d78219996dc691197805f1546f4f65faba87371f..e120c8a105eb7fbb05f16fff5d3407b9b94449cc 100644 (file)
@@ -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
index f5eb082cff2e6b156d286618af095fbb1188ca2c..186dd4ffe3af49ef1fffd2f64da131c520e368d0 100644 (file)
@@ -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);
 }
 
index 2f47c7232f84f2056c5cd31eb70919f01b76b067..4e2afefc64197da604336f64c615b72075ac1051 100644 (file)
@@ -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;
 }