[evolution-patches] fix deadlock problem with e_book_remove_contact



evolution never used this function, so we never saw how broken it was :)

Chris
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/ChangeLog,v
retrieving revision 1.121
diff -u -r1.121 ChangeLog
--- ChangeLog	7 Apr 2004 23:37:37 -0000	1.121
+++ ChangeLog	13 Apr 2004 19:11:18 -0000
@@ -1,3 +1,17 @@
+2004-04-13  Chris Toshok  <toshok ximian com>
+
+	* libebook/e-book.c (e_book_remove_contact): fix deadlock when
+	calling this function - there's no reason to lock the book's mutex
+	here, as all we do is build a list and call
+	e_book_remove_contacts, which does the locking.  Fixes
+	gnomemeeting's e-d-s problem.
+
+2004-04-12  Chris Toshok  <toshok ximian com>
+
+	* libebook/e-contact.c (e_contact_set_property): remove the
+	MULTI_ELEM attribute if the string is NULL or empty.  This keeps
+	us from writing out empty EMAIL attributes.
+
 2004-04-07  Chris Toshok  <toshok ximian com>
 
 	* libebook/e-vcard.h: reorder the EVC_X #defines a bit, and add in
Index: libebook/e-book.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/libebook/e-book.c,v
retrieving revision 1.28
diff -u -r1.28 e-book.c
--- libebook/e-book.c	25 Feb 2004 01:22:45 -0000	1.28
+++ libebook/e-book.c	13 Apr 2004 19:11:20 -0000
@@ -811,28 +811,11 @@
 	e_return_error_if_fail (book && E_IS_BOOK (book), E_BOOK_ERROR_INVALID_ARG);
 	e_return_error_if_fail (id,                       E_BOOK_ERROR_INVALID_ARG);
 
-	g_mutex_lock (book->priv->mutex);
-
-	if (book->priv->load_state != E_BOOK_URI_LOADED) {
-		g_mutex_unlock (book->priv->mutex);
-		g_set_error (error, E_BOOK_ERROR, E_BOOK_ERROR_URI_NOT_LOADED,
-			     _("\"%s\" on book before \"%s\""),
-			     "e_book_remove_contact", "e_book_load_uri");
-		return FALSE;
-	}
-
-	if (book->priv->current_op != NULL) {
-		g_mutex_unlock (book->priv->mutex);
-		g_set_error (error, E_BOOK_ERROR, E_BOOK_ERROR_BUSY,
-			     _("book busy"));
-		return FALSE;
-	}
-
-	g_mutex_lock (book->priv->mutex);
-
 	list = g_list_append (NULL, (char*)id);
 
 	rv = e_book_remove_contacts (book, list, error);
+
+	g_list_free (list);
 
 	return rv;
 }


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