[evolution-data-server] Fix for bug #578210



commit 8463fec3243663ca763851ee2d88fcb182a089f1
Author: Jedy Wang <jedy wang sun com>
Date:   Tue Apr 21 14:23:22 2009 +0800

    Fix for bug #578210
---
 ChangeLog                             |    7 +++++++
 libedataserver/e-component-listener.c |   14 ++++++--------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4dda332..cb708ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-21  Wang Xin  <jedy wang sun com>
+
+	** Fix for bug #578210
+
+	* libedataserver/e-component-listener.c: (connection_listen_cb): Updated
+	the code to handle re-entrant problem.
+
 2009-04-12  Matthew Barnes  <mbarnes redhat com>
 
 	** Remove a bunch of juvenile comments.  Source code should
diff --git a/libedataserver/e-component-listener.c b/libedataserver/e-component-listener.c
index 3dc0b59..00bd173 100644
--- a/libedataserver/e-component-listener.c
+++ b/libedataserver/e-component-listener.c
@@ -36,18 +36,17 @@ static guint comp_listener_signals[LAST_SIGNAL];
 static void
 connection_listen_cb (gpointer object, gpointer user_data)
 {
-	GList *l, *next = NULL;
 	EComponentListener *cl;
 
 	g_static_rec_mutex_lock (&watched_lock);
 
-	for (l = watched_connections; l != NULL; l = next) {
-		next = l->next;
-		cl = l->data;
-
-		switch (ORBit_small_get_connection_status (cl->priv->component)) {
+	cl = (EComponentListener *)user_data;
+	/* cl can be removed in e_component_listener_finalize */
+	if (g_list_find (watched_connections, cl) == NULL)
+		g_static_rec_mutex_unlock (&watched_lock);
+	switch (ORBit_small_get_connection_status (cl->priv->component)) {
 		case ORBIT_CONNECTION_DISCONNECTED :
-			watched_connections = g_list_delete_link (watched_connections, l);
+			watched_connections = g_list_remove (watched_connections, cl);
 
 			g_object_ref (cl);
 			g_signal_emit (cl, comp_listener_signals[COMPONENT_DIED], 0);
@@ -56,7 +55,6 @@ connection_listen_cb (gpointer object, gpointer user_data)
 			break;
 		default :
 			break;
-		}
 	}
 
 	g_static_rec_mutex_unlock (&watched_lock);



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