[evolution/webkit] Fix build breaks.



commit c97580e0d9e4d7f7cbcd4fd0a018caac475ff1bf
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Jun 1 06:04:16 2011 -0400

    Fix build breaks.

 mail/e-mail-store.c |   20 ++++++++++----------
 mail/mail-mt.c      |   37 +++++++++++++++++++------------------
 2 files changed, 29 insertions(+), 28 deletions(-)
---
diff --git a/mail/e-mail-store.c b/mail/e-mail-store.c
index 1aef04a..948683d 100644
--- a/mail/e-mail-store.c
+++ b/mail/e-mail-store.c
@@ -104,7 +104,7 @@ store_info_ref (StoreInfo *store_info)
 	g_return_val_if_fail (store_info != NULL, store_info);
 	g_return_val_if_fail (store_info->ref_count > 0, store_info);
 
-	g_atomic_int_add (&store_info->ref_count, 1);
+	g_atomic_int_inc (&store_info->ref_count);
 
 	return store_info;
 }
@@ -115,19 +115,19 @@ store_info_unref (StoreInfo *store_info)
 	g_return_if_fail (store_info != NULL);
 	g_return_if_fail (store_info->ref_count > 0);
 
-	if (g_atomic_int_add (&store_info->ref_count, -1) > 1)
-		return;
+	if (g_atomic_int_dec_and_test (&store_info->ref_count)) {
 
-	g_object_unref (store_info->store);
-	g_free (store_info->display_name);
+		g_object_unref (store_info->store);
+		g_free (store_info->display_name);
 
-	if (store_info->vtrash != NULL)
-		g_object_unref (store_info->vtrash);
+		if (store_info->vtrash != NULL)
+			g_object_unref (store_info->vtrash);
 
-	if (store_info->vjunk != NULL)
-		g_object_unref (store_info->vjunk);
+		if (store_info->vjunk != NULL)
+			g_object_unref (store_info->vjunk);
 
-	g_slice_free (StoreInfo, store_info);
+		g_slice_free (StoreInfo, store_info);
+	}
 }
 
 static void
diff --git a/mail/mail-mt.c b/mail/mail-mt.c
index 5ef8a01..724498c 100644
--- a/mail/mail-mt.c
+++ b/mail/mail-mt.c
@@ -153,7 +153,8 @@ mail_msg_ref (gpointer msg)
 	g_return_val_if_fail (mail_msg != NULL, msg);
 	g_return_val_if_fail (mail_msg->ref_count > 0, msg);
 
-	g_atomic_int_add (&mail_msg->ref_count, 1);
+	g_atomic_int_inc (&mail_msg->ref_count);
+
 	return msg;
 }
 
@@ -165,31 +166,31 @@ mail_msg_unref (gpointer msg)
 	g_return_if_fail (mail_msg != NULL);
 	g_return_if_fail (mail_msg->ref_count > 0);
 
-	if (g_atomic_int_add (&mail_msg->ref_count, -1) > 1)
-		return;
+	if (g_atomic_int_dec_and_test (&mail_msg->ref_count)) {
 
 #ifdef MALLOC_CHECK
-	checkmem (mail_msg);
-	checkmem (mail_msg->cancel);
-	checkmem (mail_msg->priv);
+		checkmem (mail_msg);
+		checkmem (mail_msg->cancel);
+		checkmem (mail_msg->priv);
 #endif
-	d(printf("Free message %p\n", msg));
+		d(printf("Free message %p\n", msg));
 
-	if (mail_msg->info->free)
-		mail_msg->info->free (mail_msg);
+		if (mail_msg->info->free)
+			mail_msg->info->free (mail_msg);
 
-	g_mutex_lock (mail_msg_lock);
+		g_mutex_lock (mail_msg_lock);
 
-	g_hash_table_remove (
-		mail_msg_active_table,
-		GINT_TO_POINTER (mail_msg->seq));
-	g_cond_broadcast (mail_msg_cond);
+		g_hash_table_remove (
+			mail_msg_active_table,
+			GINT_TO_POINTER (mail_msg->seq));
+		g_cond_broadcast (mail_msg_cond);
 
-	g_mutex_unlock (mail_msg_lock);
+		g_mutex_unlock (mail_msg_lock);
 
-	/* Destroy the message from an idle callback
-	 * so we know we're in the main loop thread. */
-	g_idle_add ((GSourceFunc) mail_msg_free, mail_msg);
+		/* Destroy the message from an idle callback
+		 * so we know we're in the main loop thread. */
+		g_idle_add ((GSourceFunc) mail_msg_free, mail_msg);
+	}
 }
 
 void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]