Index: widgets/rb-entry-view.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/widgets/rb-entry-view.c,v
retrieving revision 1.160
diff -u -p -u -p -r1.160 rb-entry-view.c
--- widgets/rb-entry-view.c	27 Oct 2006 13:37:07 -0000	1.160
+++ widgets/rb-entry-view.c	6 Nov 2006 22:12:38 -0000
@@ -58,6 +58,7 @@ static void rb_entry_view_class_init (RB
 static void rb_entry_view_init (RBEntryView *view);
 static GObject *rb_entry_view_constructor (GType type, guint n_construct_properties,
 					   GObjectConstructParam *construct_properties);
+static void rb_entry_view_dispose (GObject *object);
 static void rb_entry_view_finalize (GObject *object);
 static void rb_entry_view_set_property (GObject *object,
 				       guint prop_id,
@@ -221,6 +222,7 @@ rb_entry_view_class_init (RBEntryViewCla
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
 	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
+	object_class->dispose = rb_entry_view_dispose;
 	object_class->finalize = rb_entry_view_finalize;
 	object_class->constructor = rb_entry_view_constructor;
 
@@ -394,7 +396,7 @@ rb_entry_view_init (RBEntryView *view)
 }
 
 static void
-rb_entry_view_finalize (GObject *object)
+rb_entry_view_dispose (GObject *object)
 {
 	RBEntryView *view;
 
@@ -405,31 +407,64 @@ rb_entry_view_finalize (GObject *object)
 
 	g_return_if_fail (view->priv != NULL);
 
-	if (view->priv->gconf_notification_id > 0)
+	if (view->priv->gconf_notification_id > 0) {
 		eel_gconf_notification_remove (view->priv->gconf_notification_id);
-	if (view->priv->sorting_gconf_notification_id > 0)
+		view->priv->gconf_notification_id = 0;
+	}
+
+	if (view->priv->sorting_gconf_notification_id > 0) {
 		eel_gconf_notification_remove (view->priv->sorting_gconf_notification_id);
+		view->priv->sorting_gconf_notification_id = 0;
+	}
 
-	if (view->priv->selection_changed_id > 0)
+	if (view->priv->selection_changed_id > 0) {
 		g_source_remove (view->priv->selection_changed_id);
+		view->priv->selection_changed_id = 0;
+	}
 
-	g_hash_table_destroy (view->priv->propid_column_map);
-	g_hash_table_destroy (view->priv->column_sort_data_map);
-	g_hash_table_destroy (view->priv->column_key_map);
-
-	if (view->priv->playing_pixbuf != NULL)
+	if (view->priv->playing_pixbuf != NULL) {
 		g_object_unref (view->priv->playing_pixbuf);
-	if (view->priv->paused_pixbuf != NULL)
+		view->priv->playing_pixbuf = NULL;
+	}
+
+	if (view->priv->paused_pixbuf != NULL) {
 		g_object_unref (view->priv->paused_pixbuf);
-	if (view->priv->error_pixbuf != NULL)
+		view->priv->paused_pixbuf = NULL;
+	}
+
+	if (view->priv->error_pixbuf != NULL) {
 		g_object_unref (view->priv->error_pixbuf);
+		view->priv->error_pixbuf = NULL;
+	}
 
 	if (view->priv->playing_model != NULL) {
 		g_object_unref (view->priv->playing_model);
+		view->priv->playing_model = NULL;
 	}
+
 	if (view->priv->model != NULL) {
 		g_object_unref (view->priv->model);
+		view->priv->model = NULL;
 	}
+
+	G_OBJECT_CLASS (rb_entry_view_parent_class)->dispose (object);
+}
+
+static void
+rb_entry_view_finalize (GObject *object)
+{
+	RBEntryView *view;
+
+	g_return_if_fail (object != NULL);
+	g_return_if_fail (RB_IS_ENTRY_VIEW (object));
+
+	view = RB_ENTRY_VIEW (object);
+
+	g_return_if_fail (view->priv != NULL);
+
+	g_hash_table_destroy (view->priv->propid_column_map);
+	g_hash_table_destroy (view->priv->column_sort_data_map);
+	g_hash_table_destroy (view->priv->column_key_map);
 
 	g_free (view->priv->sorting_key);
 	g_free (view->priv->sorting_column_name);
