[tracker/collation-gconf-locale: 13/20] tracker-locale: New log added when looping subscriber list



commit e17ffd7c9f81351196709853e5d61efea8d5ddeb
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Thu Oct 28 18:07:48 2010 +0200

    tracker-locale: New log added when looping subscriber list

 src/libtracker-common/tracker-locale.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-common/tracker-locale.c b/src/libtracker-common/tracker-locale.c
index b4c0dfb..cc0a7b2 100644
--- a/src/libtracker-common/tracker-locale.c
+++ b/src/libtracker-common/tracker-locale.c
@@ -198,13 +198,20 @@ tracker_locale_gconf_notify_cb (GConfClient *client,
 	tracker_locale_set (i, gconf_value_get_string (value));
 	UNLOCK_LOCALES;
 
-	/* Now, if any subscriber, notify the locale change */
+	/* Now, if any subscriber, notify the locale change.
+	 * NOTE!!!! The callback MUST NOT perform any action
+	 * that may change the list of subscribers, or the
+	 * program will get locked. */
 	LOCK_SUBSCRIBERS;
 	for (li = subscribers; li; li = g_slist_next (li)) {
 		TrackerLocaleNotification *data = li->data;
 
-		if (i == data->id)
+		if (i == data->id) {
+			g_debug ("Notifying locale '%s' change to subscriber '%p'",
+			         locale_names[i],
+			         data);
 			data->func (i, data->user_data);
+		}
 	}
 	UNLOCK_SUBSCRIBERS;
 }
@@ -389,7 +396,7 @@ tracker_locale_notify_remove (gpointer notification_id)
 		/* Remove item from list of subscribers */
 		subscribers = g_slist_delete_link (subscribers, li);
 
-		/* Call the provided destroy_notify if any */
+		/* Call the provided destroy_notify if any. */
 		if (data->destroy_notify)
 			data->destroy_notify (data->user_data);
 		/* And fully dispose the notification data */



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