[nautilus/gnome-3-2] places-sidebar: disconnect volume monitor signals on dispose



commit a77c094bc82baf3403321420662837e96c6e5306
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Sep 29 00:59:37 2011 -0400

    places-sidebar: disconnect volume monitor signals on dispose
    
    The GIO volume monitor can survive the sidebar, so we need to disconnect
    its signals handlers on dispose.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=652320

 src/nautilus-places-sidebar.c |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
index 4ebe023..33b9086 100644
--- a/src/nautilus-places-sidebar.c
+++ b/src/nautilus-places-sidebar.c
@@ -465,6 +465,8 @@ update_places (NautilusPlacesSidebar *sidebar)
 	GList *network_mounts;
 	NautilusFile *file;
 
+	DEBUG ("Updating places sidebar");
+
 	model = NULL;
 	last_uri = NULL;
 	select_path = NULL;
@@ -3311,7 +3313,6 @@ nautilus_places_sidebar_dispose (GObject *object)
 	}
 
 	g_clear_object (&sidebar->store);
-	g_clear_object (&sidebar->volume_monitor);
 	g_clear_object (&sidebar->bookmarks);
 	g_clear_object (&sidebar->filter_model);
 
@@ -3329,6 +3330,29 @@ nautilus_places_sidebar_dispose (GObject *object)
 					      desktop_setting_changed_callback,
 					      sidebar);
 
+	if (sidebar->volume_monitor != NULL) {
+		g_signal_handlers_disconnect_by_func (sidebar->volume_monitor, 
+						      volume_added_callback, sidebar);
+		g_signal_handlers_disconnect_by_func (sidebar->volume_monitor, 
+						      volume_removed_callback, sidebar);
+		g_signal_handlers_disconnect_by_func (sidebar->volume_monitor, 
+						      volume_changed_callback, sidebar);
+		g_signal_handlers_disconnect_by_func (sidebar->volume_monitor, 
+						      mount_added_callback, sidebar);
+		g_signal_handlers_disconnect_by_func (sidebar->volume_monitor, 
+						      mount_removed_callback, sidebar);
+		g_signal_handlers_disconnect_by_func (sidebar->volume_monitor, 
+						      mount_changed_callback, sidebar);
+		g_signal_handlers_disconnect_by_func (sidebar->volume_monitor, 
+						      drive_disconnected_callback, sidebar);
+		g_signal_handlers_disconnect_by_func (sidebar->volume_monitor, 
+						      drive_connected_callback, sidebar);
+		g_signal_handlers_disconnect_by_func (sidebar->volume_monitor, 
+						      drive_changed_callback, sidebar);
+
+		g_clear_object (&sidebar->volume_monitor);
+	}
+
 	G_OBJECT_CLASS (nautilus_places_sidebar_parent_class)->dispose (object);
 }
 



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