nautilus r14039 - in trunk: . src



Author: cneumair
Date: Fri Apr  4 18:03:53 2008
New Revision: 14039
URL: http://svn.gnome.org/viewvc/nautilus?rev=14039&view=rev

Log:
2008-04-04  Christian Neumair  <cneumair gnome org>

	* src/nautilus-places-sidebar.c (nautilus_places_sidebar_init),
	(nautilus_places_sidebar_dispose),
	(nautilus_places_sidebar_class_init):

	Move finalize to dispose, unset pointers to window/tree_view, use
	eel_preferences_add_callback_while_alive().


Modified:
   trunk/ChangeLog
   trunk/src/nautilus-places-sidebar.c

Modified: trunk/src/nautilus-places-sidebar.c
==============================================================================
--- trunk/src/nautilus-places-sidebar.c	(original)
+++ trunk/src/nautilus-places-sidebar.c	Fri Apr  4 18:03:53 2008
@@ -1960,9 +1960,10 @@
 	g_signal_connect (tree_view, "button-press-event",
 			  G_CALLBACK (bookmarks_button_press_event_cb), sidebar);
 
-	eel_preferences_add_callback (NAUTILUS_PREFERENCES_CLICK_POLICY,
-				      click_policy_changed_callback,
-				      sidebar);
+	eel_preferences_add_callback_while_alive (NAUTILUS_PREFERENCES_CLICK_POLICY,
+						  click_policy_changed_callback,
+						  sidebar,
+						  G_OBJECT (sidebar));
 	update_click_policy (sidebar);
 
 	eel_preferences_add_callback_while_alive (NAUTILUS_PREFERENCES_DESKTOP_IS_HOME_DIR,
@@ -1977,12 +1978,15 @@
 }
 
 static void
-nautilus_places_sidebar_finalize (GObject *object)
+nautilus_places_sidebar_dispose (GObject *object)
 {
 	NautilusPlacesSidebar *sidebar;
-	
+
 	sidebar = NAUTILUS_PLACES_SIDEBAR (object);
 
+	sidebar->window = NULL;
+	sidebar->tree_view = NULL;
+
 	g_free (sidebar->uri);
 	sidebar->uri = NULL;
 
@@ -1993,19 +1997,18 @@
 		sidebar->store = NULL;
 	}
 
-	g_object_unref (sidebar->volume_monitor);
-	
-	eel_preferences_remove_callback (NAUTILUS_PREFERENCES_CLICK_POLICY,
-					 click_policy_changed_callback,
-					 sidebar);
+	if (sidebar->volume_monitor != NULL) {
+		g_object_unref (sidebar->volume_monitor);
+		sidebar->volume_monitor = NULL;
+	}
 
-	G_OBJECT_CLASS (nautilus_places_sidebar_parent_class)->finalize (object);
+	G_OBJECT_CLASS (nautilus_places_sidebar_parent_class)->dispose (object);
 }
 
 static void
 nautilus_places_sidebar_class_init (NautilusPlacesSidebarClass *class)
 {
-	G_OBJECT_CLASS (class)->finalize = nautilus_places_sidebar_finalize;
+	G_OBJECT_CLASS (class)->dispose = nautilus_places_sidebar_dispose;
 
 	GTK_WIDGET_CLASS (class)->style_set = nautilus_places_sidebar_style_set;
 }



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