Index: rhythmdb/rhythmdb-query-model.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/rhythmdb/rhythmdb-query-model.c,v
retrieving revision 1.135
diff -p -u -r1.135 rhythmdb-query-model.c
--- rhythmdb/rhythmdb-query-model.c	14 Jul 2006 12:29:29 -0000	1.135
+++ rhythmdb/rhythmdb-query-model.c	14 Jul 2006 12:43:50 -0000
@@ -437,6 +437,7 @@ rhythmdb_query_model_set_property (GObje
 		model->priv->db = g_value_get_object (value);
 		break;
 	case PROP_QUERY:
+		rhythmdb_query_free (model->priv->query);
 		model->priv->query = rhythmdb_query_copy (g_value_get_pointer (value));
 		model->priv->original_query = rhythmdb_query_copy (model->priv->query);
 		rhythmdb_query_preprocess (model->priv->db, model->priv->query);
Index: shell/main.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/main.c,v
retrieving revision 1.99
diff -p -u -r1.99 main.c
--- shell/main.c	14 Jul 2006 12:30:49 -0000	1.99
+++ shell/main.c	14 Jul 2006 12:43:50 -0000
@@ -390,6 +390,8 @@ main (int argc, char **argv)
 
 	rb_debug ("THE END");
 	rb_profile_end ("starting rhythmbox");
+	g_object_unref (program);
+
 	exit (0);
 }
 
Index: shell/rb-shell-clipboard.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell-clipboard.c,v
retrieving revision 1.47
diff -p -u -r1.47 rb-shell-clipboard.c
--- shell/rb-shell-clipboard.c	14 Jul 2006 12:30:51 -0000	1.47
+++ shell/rb-shell-clipboard.c	14 Jul 2006 12:43:51 -0000
@@ -245,6 +245,24 @@ rb_shell_clipboard_init (RBShellClipboar
 }
 
 static void
+unset_source_internal (RBShellClipboard *clipboard)
+{
+	if (clipboard->priv->source != NULL) {
+		RBEntryView *songs = rb_source_get_entry_view (clipboard->priv->source);
+
+		if (songs) {
+			g_signal_handlers_disconnect_by_func (G_OBJECT (songs),
+							      G_CALLBACK (rb_shell_clipboard_entryview_changed_cb),
+							      clipboard);
+			g_signal_handlers_disconnect_by_func (G_OBJECT (songs),
+							      G_CALLBACK (rb_shell_clipboard_entries_changed_cb),
+							      clipboard);
+		}
+	}
+	clipboard->priv->source = NULL;
+}
+
+static void
 rb_shell_clipboard_finalize (GObject *object)
 {
 	RBShellClipboard *shell_clipboard;
@@ -256,6 +274,9 @@ rb_shell_clipboard_finalize (GObject *ob
 
 	g_return_if_fail (shell_clipboard->priv != NULL);
 
+	/* release references to the source */
+	unset_source_internal (shell_clipboard);
+
 	g_hash_table_destroy (shell_clipboard->priv->signal_hash);
 
 	g_list_free (shell_clipboard->priv->entries);
@@ -299,18 +320,8 @@ static void
 rb_shell_clipboard_set_source_internal (RBShellClipboard *clipboard,
 					RBSource *source)
 {
-	if (clipboard->priv->source != NULL) {
-		RBEntryView *songs = rb_source_get_entry_view (clipboard->priv->source);
+	unset_source_internal (clipboard);
 
-		if (songs) {
-			g_signal_handlers_disconnect_by_func (G_OBJECT (songs),
-							      G_CALLBACK (rb_shell_clipboard_entryview_changed_cb),
-							      clipboard);
-			g_signal_handlers_disconnect_by_func (G_OBJECT (songs),
-							      G_CALLBACK (rb_shell_clipboard_entries_changed_cb),
-							      clipboard);
-		}
-	}
 	clipboard->priv->source = source;
 	rb_debug ("selected source %p", source);
 
@@ -369,8 +380,14 @@ rb_shell_clipboard_set_property (GObject
 		clipboard->priv->ui_mgr = g_value_get_object (value);
 		break;
 	case PROP_PLAYLIST_MANAGER:
+		if (clipboard->priv->playlist_manager != NULL) {
+			g_signal_handlers_disconnect_by_func (clipboard->priv->playlist_manager,
+							      G_CALLBACK (rb_shell_clipboard_playlist_added_cb),
+							      clipboard);
+		}
+
 		clipboard->priv->playlist_manager = g_value_get_object (value);
-		if (clipboard->priv->playlist_manager) {
+		if (clipboard->priv->playlist_manager != NULL) {
 			g_signal_connect_object (G_OBJECT (clipboard->priv->playlist_manager),
 						 "playlist-added", G_CALLBACK (rb_shell_clipboard_playlist_added_cb),
 						 clipboard, 0);
@@ -380,14 +397,23 @@ rb_shell_clipboard_set_property (GObject
 
 		break;
 	case PROP_QUEUE_SOURCE:
+		if (clipboard->priv->queue_source != NULL) {
+			RBEntryView *sidebar;
+			g_object_get (clipboard->priv->queue_source, "sidebar", &sidebar, NULL);
+			g_signal_handlers_disconnect_by_func (sidebar,
+							      G_CALLBACK (rb_shell_clipboard_entryview_changed_cb),
+							      clipboard);
+			g_object_unref (sidebar);
+		}
+
 		clipboard->priv->queue_source = g_value_get_object (value);
-		if (clipboard->priv->queue_source) {
+		if (clipboard->priv->queue_source != NULL) {
 			RBEntryView *sidebar;
-			g_object_get (G_OBJECT (clipboard->priv->queue_source), "sidebar", &sidebar, NULL);
+			g_object_get (clipboard->priv->queue_source, "sidebar", &sidebar, NULL);
 			g_signal_connect_object (G_OBJECT (sidebar), "selection-changed",
 						 G_CALLBACK (rb_shell_clipboard_entryview_changed_cb),
 						 clipboard, 0);
-			g_object_unref (G_OBJECT (sidebar));
+			g_object_unref (sidebar);
 		}
 		break;
 	default:
@@ -920,11 +946,19 @@ rebuild_playlist_menu (RBShellClipboard 
 			gtk_ui_manager_new_merge_id (clipboard->priv->ui_mgr);
 	}
 
-	g_object_get (G_OBJECT (clipboard->priv->playlist_manager), "sourcelist", &sourcelist, NULL);
-	g_object_get (sourcelist, "model", &model, NULL);
-	g_object_unref (sourcelist);
-	gtk_tree_model_foreach (model, (GtkTreeModelForeachFunc)add_playlist_to_menu, clipboard);
-	g_object_unref (G_OBJECT (model));
+	if (clipboard->priv->playlist_manager != NULL) {
+		g_object_get (clipboard->priv->playlist_manager, "sourcelist", &sourcelist, NULL);
+	}
+
+	if (sourcelist != NULL) {
+		g_object_get (sourcelist, "model", &model, NULL);
+		g_object_unref (sourcelist);
+	}
+
+	if (model != NULL) {
+		gtk_tree_model_foreach (model, (GtkTreeModelForeachFunc)add_playlist_to_menu, clipboard);
+		g_object_unref (G_OBJECT (model));
+	}
 
 	clipboard->priv->idle_playlist_id = 0;
 	return FALSE;
Index: shell/rb-shell-player.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell-player.c,v
retrieving revision 1.250
diff -p -u -r1.250 rb-shell-player.c
--- shell/rb-shell-player.c	14 Jul 2006 12:30:51 -0000	1.250
+++ shell/rb-shell-player.c	14 Jul 2006 12:43:53 -0000
@@ -629,54 +629,30 @@ rb_shell_player_init (RBShellPlayer *pla
 }
 
 static void
-rb_shell_player_finalize (GObject *object)
-{
-	RBShellPlayer *player;
-
-	g_return_if_fail (object != NULL);
-	g_return_if_fail (RB_IS_SHELL_PLAYER (object));
-
-	player = RB_SHELL_PLAYER (object);
-
-	g_return_if_fail (player->priv != NULL);
-
-	eel_gconf_notification_remove (player->priv->gconf_play_order_id);
-
-	eel_gconf_set_float (CONF_STATE_VOLUME, player->priv->volume);
-
-	g_object_unref (G_OBJECT (player->priv->mmplayer));
-	g_object_unref (G_OBJECT (player->priv->play_order));
-
-	G_OBJECT_CLASS (rb_shell_player_parent_class)->finalize (object);
-}
-
-static void
-rb_shell_player_set_property (GObject *object,
-			      guint prop_id,
-			      const GValue *value,
-			      GParamSpec *pspec)
+rb_shell_player_set_source_internal (RBShellPlayer *player,
+				     RBSource      *source)
 {
-	RBShellPlayer *player = RB_SHELL_PLAYER (object);
-
-	switch (prop_id) {
-	case PROP_SOURCE:
 		if (player->priv->selected_source != NULL) {
 			RBEntryView *songs = rb_source_get_entry_view (player->priv->selected_source);
 			GList *property_views = rb_source_get_property_views (player->priv->selected_source);
 
-			if (songs)
+			if (songs != NULL) {
 				g_signal_handlers_disconnect_by_func (G_OBJECT (songs),
 								      G_CALLBACK (rb_shell_player_entry_activated_cb),
 								      player);
-			for (; property_views; property_views = property_views->next)
+			}
+
+			for (; property_views; property_views = property_views->next) {
 				g_signal_handlers_disconnect_by_func (G_OBJECT (property_views->data),
 								      G_CALLBACK (rb_shell_player_property_row_activated_cb),
 								      player);
-			g_list_free (property_views);
+			}
 
+			g_list_free (property_views);
 		}
 
-		player->priv->selected_source = g_value_get_object (value);
+		player->priv->selected_source = source;
+
 		rb_debug ("selected source %p", player->priv->selected_source);
 
 		rb_shell_player_sync_with_selected_source (player);
@@ -711,19 +687,119 @@ rb_shell_player_set_property (GObject *o
 
 			rb_play_order_playing_source_changed (player->priv->play_order, source);
 		}
+}
+
+static void
+rb_shell_player_set_db_internal (RBShellPlayer *player,
+				 RhythmDB      *db)
+{
+	if (player->priv->db != NULL) {
+		g_signal_handlers_disconnect_by_func (player->priv->db,
+						      G_CALLBACK (rb_shell_player_entry_changed_cb),
+						      player);
+	}
+
+	player->priv->db = db;
+
+	if (player->priv->db != NULL) {
+		/* Listen for changed entries to update metadata display */
+		g_signal_connect_object (G_OBJECT (player->priv->db),
+					 "entry_changed",
+					 G_CALLBACK (rb_shell_player_entry_changed_cb),
+					 player, 0);
+	}
+}
+
+static void
+rb_shell_player_set_queue_source_internal (RBShellPlayer     *player,
+					   RBPlayQueueSource *source)
+{
+	if (player->priv->queue_source != NULL) {
+		RBEntryView *sidebar;
 
+		g_object_get (G_OBJECT (player->priv->queue_source), "sidebar", &sidebar, NULL);
+		g_signal_handlers_disconnect_by_func (sidebar,
+						      G_CALLBACK (rb_shell_player_entry_activated_cb),
+						      player);
+		g_object_unref (sidebar);
+
+		if (player->priv->queue_play_order != NULL) {
+			g_signal_handlers_disconnect_by_func (player->priv->queue_play_order,
+							      G_CALLBACK (rb_shell_player_play_order_update_cb),
+							      player);
+			g_object_unref (player->priv->queue_play_order);
+		}
+
+	}
+
+	player->priv->queue_source = source;
+
+	if (player->priv->queue_source != NULL) {
+		RBEntryView *sidebar;
+
+		player->priv->queue_play_order = rb_play_order_new ("queue", player);
+		g_signal_connect_object (G_OBJECT (player->priv->queue_play_order),
+					 "have_next_previous_changed",
+					 G_CALLBACK (rb_shell_player_play_order_update_cb),
+					 player, 0);
+		rb_shell_player_play_order_update_cb (player->priv->play_order,
+						      FALSE, FALSE,
+						      player);
+		rb_play_order_playing_source_changed (player->priv->queue_play_order,
+						      RB_SOURCE (player->priv->queue_source));
+
+		g_object_get (G_OBJECT (player->priv->queue_source), "sidebar", &sidebar, NULL);
+		g_signal_connect_object (G_OBJECT (sidebar),
+					 "entry-activated",
+					 G_CALLBACK (rb_shell_player_entry_activated_cb),
+					 player, 0);
+		g_object_unref (sidebar);
+	}
+}
+
+static void
+rb_shell_player_finalize (GObject *object)
+{
+	RBShellPlayer *player;
+
+	g_return_if_fail (object != NULL);
+	g_return_if_fail (RB_IS_SHELL_PLAYER (object));
+
+	player = RB_SHELL_PLAYER (object);
+
+	g_return_if_fail (player->priv != NULL);
+
+	rb_shell_player_set_source_internal (player, NULL);
+	rb_shell_player_set_queue_source_internal (player, NULL);
+	rb_shell_player_set_db_internal (player, NULL);
+
+	eel_gconf_notification_remove (player->priv->gconf_play_order_id);
+
+	eel_gconf_set_float (CONF_STATE_VOLUME, player->priv->volume);
+
+	g_object_unref (G_OBJECT (player->priv->mmplayer));
+	g_object_unref (G_OBJECT (player->priv->play_order));
+
+	G_OBJECT_CLASS (rb_shell_player_parent_class)->finalize (object);
+}
+
+static void
+rb_shell_player_set_property (GObject *object,
+			      guint prop_id,
+			      const GValue *value,
+			      GParamSpec *pspec)
+{
+	RBShellPlayer *player = RB_SHELL_PLAYER (object);
+
+	switch (prop_id) {
+	case PROP_SOURCE:
+		rb_shell_player_set_source_internal (player, g_value_get_object (value));
 		break;
 	case PROP_UI_MANAGER:
 		player->priv->ui_manager = g_value_get_object (value);
 		break;
 	case PROP_DB:
-		player->priv->db = g_value_get_object (value);
-
-		/* Listen for changed entries to update metadata display */
-		g_signal_connect_object (G_OBJECT (player->priv->db),
-			 "entry_changed",
-			 G_CALLBACK (rb_shell_player_entry_changed_cb),
-			 player, 0);
+		rb_shell_player_set_db_internal (player, g_value_get_object (value));
 		break;
 	case PROP_ACTION_GROUP:
 		player->priv->actiongroup = g_value_get_object (value);
@@ -740,28 +816,7 @@ rb_shell_player_set_property (GObject *o
 		player->priv->statusbar_widget = g_value_get_object (value);
 		break;
 	case PROP_QUEUE_SOURCE:
-		player->priv->queue_source = g_value_get_object (value);
-		if (player->priv->queue_source) {
-			RBEntryView *sidebar;
-
-			player->priv->queue_play_order = rb_play_order_new ("queue", player);
-			g_signal_connect_object (G_OBJECT (player->priv->queue_play_order),
-						 "have_next_previous_changed",
-						 G_CALLBACK (rb_shell_player_play_order_update_cb),
-						 player, 0);
-			rb_shell_player_play_order_update_cb (player->priv->play_order,
-							      FALSE, FALSE,
-							      player);
-			rb_play_order_playing_source_changed (player->priv->queue_play_order,
-							      RB_SOURCE (player->priv->queue_source));
-
-			g_object_get (G_OBJECT (player->priv->queue_source), "sidebar", &sidebar, NULL);
-			g_signal_connect_object (G_OBJECT (sidebar),
-						 "entry-activated",
-						 G_CALLBACK (rb_shell_player_entry_activated_cb),
-						 player, 0);
-			g_object_unref (sidebar);
-		}
+		rb_shell_player_set_queue_source_internal (player, g_value_get_object (value));
 		break;
 	case PROP_QUEUE_ONLY:
 		player->priv->queue_only = g_value_get_boolean (value);
Index: shell/rb-shell.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell.c,v
retrieving revision 1.461
diff -p -u -r1.461 rb-shell.c
--- shell/rb-shell.c	14 Jul 2006 12:30:52 -0000	1.461
+++ shell/rb-shell.c	14 Jul 2006 12:43:55 -0000
@@ -872,6 +872,10 @@ rb_shell_finalize (GObject *object)
 		shell->priv->save_db_id = 0;
 	}
 
+	if (shell->priv->queue_sidebar != NULL) {
+		g_object_unref (shell->priv->queue_sidebar);
+	}
+
 	rb_debug ("shutting down playlist manager");
 	rb_playlist_manager_shutdown (shell->priv->playlist_manager);
 
@@ -1140,7 +1144,6 @@ construct_sources (RBShell *shell)
 	rb_shell_append_source (shell, RB_SOURCE (shell->priv->iradio_source), NULL);
 	shell->priv->podcast_source = RB_PODCAST_SOURCE (rb_podcast_source_new (shell));
 	rb_shell_append_source (shell, RB_SOURCE (shell->priv->podcast_source), NULL);
-
 	shell->priv->missing_files_source = rb_missing_files_source_new (shell, shell->priv->library_source);
 	rb_shell_append_source (shell, shell->priv->missing_files_source, RB_SOURCE (shell->priv->library_source));
 	shell->priv->import_errors_source = rb_import_errors_source_new (shell, shell->priv->library_source);
Index: sources/rb-auto-playlist-source.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-auto-playlist-source.c,v
retrieving revision 1.24
diff -p -u -r1.24 rb-auto-playlist-source.c
--- sources/rb-auto-playlist-source.c	14 Jul 2006 12:31:29 -0000	1.24
+++ sources/rb-auto-playlist-source.c	14 Jul 2006 12:43:56 -0000
@@ -19,12 +19,13 @@
  *
  */
 
-#include <config.h>
+#include "config.h"
+
+#include <string.h>
+#include <libxml/tree.h>
+#include <glib/gi18n.h>
 #include <gtk/gtk.h>
-#include <libgnome/gnome-i18n.h>
 #include <libgnomevfs/gnome-vfs-uri.h>
-#include <libxml/tree.h>
-#include <string.h>
 
 #include "rb-auto-playlist-source.h"
 #include "rb-library-browser.h"
@@ -210,10 +211,11 @@ rb_auto_playlist_source_constructor (GTy
 	g_object_unref (G_OBJECT (shell));
 
 	/* reparent the entry view */
-	g_object_ref (G_OBJECT (songs));
+	g_object_ref (songs);
 	gtk_container_remove (GTK_CONTAINER (source), GTK_WIDGET (songs));
 	gtk_paned_pack2 (GTK_PANED (priv->paned), GTK_WIDGET (songs), TRUE, FALSE);
 	gtk_container_add (GTK_CONTAINER (source), priv->paned);
+	g_object_unref (songs);
 
 	gtk_widget_show_all (GTK_WIDGET (source));
 
@@ -239,7 +241,6 @@ RBSource *
 rb_auto_playlist_source_new_from_xml (RBShell *shell, xmlNodePtr node)
 {
 	RBAutoPlaylistSource *source = RB_AUTO_PLAYLIST_SOURCE (rb_auto_playlist_source_new (shell, NULL, TRUE));
-
 	xmlNodePtr child;
 	xmlChar *tmp;
 	GPtrArray *query;
@@ -325,6 +326,7 @@ rb_auto_playlist_source_new_from_xml (RB
 					   sort_direction);
 	g_free (sort_key);
 	g_value_array_free (limit_value);
+	rhythmdb_query_free (query);
 
 	return RB_SOURCE (source);
 }
Index: sources/rb-daap-source.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-daap-source.c,v
retrieving revision 1.39
diff -p -u -r1.39 rb-daap-source.c
--- sources/rb-daap-source.c	14 Jul 2006 12:31:29 -0000	1.39
+++ sources/rb-daap-source.c	14 Jul 2006 12:43:58 -0000
@@ -549,6 +549,10 @@ create_pixbufs (void)
 	emblem = gtk_icon_theme_load_icon (theme, "stock_lock", size, 0, NULL);
 
 	daap_share_locked_pixbuf = composite_icons (daap_share_pixbuf, emblem);
+
+	if (emblem != NULL) {
+		g_object_unref (emblem);
+	}
 }
 
 static void
Index: sources/rb-ipod-source.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-ipod-source.c,v
retrieving revision 1.59
diff -p -u -r1.59 rb-ipod-source.c
--- sources/rb-ipod-source.c	14 Jul 2006 12:31:29 -0000	1.59
+++ sources/rb-ipod-source.c	14 Jul 2006 12:43:58 -0000
@@ -19,12 +19,12 @@
  *
  */
 
-#include <config.h>
+#include "config.h"
 
-#include <gtk/gtktreeview.h>
 #include <string.h>
-#include "rhythmdb.h"
-#include <libgnome/gnome-i18n.h>
+
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
 #ifdef HAVE_HAL
 #include <libhal.h>
 #include <dbus/dbus.h>
@@ -33,6 +33,7 @@
 #include <libgnomevfs/gnome-vfs-volume.h>
 #include <libgnomevfs/gnome-vfs-volume-monitor.h>
 #include <gpod/itdb.h>
+
 #include "eel-gconf-extensions.h"
 #include "rb-ipod-source.h"
 #include "rb-debug.h"
Index: sources/rb-iradio-source.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-iradio-source.c,v
retrieving revision 1.124
diff -p -u -r1.124 rb-iradio-source.c
--- sources/rb-iradio-source.c	14 Jul 2006 12:31:29 -0000	1.124
+++ sources/rb-iradio-source.c	14 Jul 2006 12:43:58 -0000
@@ -290,6 +290,7 @@ rb_iradio_source_constructor (GType type
 	source->priv->stations = rb_entry_view_new (source->priv->db, shell_player,
 						    CONF_STATE_IRADIO_SORTING,
 						    FALSE, FALSE);
+
 	rb_entry_view_append_column (source->priv->stations, RB_ENTRY_VIEW_COL_TITLE, TRUE);
 	rb_entry_view_append_column (source->priv->stations, RB_ENTRY_VIEW_COL_GENRE, FALSE);
 /* 	rb_entry_view_append_column (source->priv->stations, RB_ENTRY_VIEW_COL_QUALITY, FALSE); */
Index: sources/rb-library-source.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-library-source.c,v
retrieving revision 1.176
diff -p -u -r1.176 rb-library-source.c
--- sources/rb-library-source.c	14 Jul 2006 12:31:29 -0000	1.176
+++ sources/rb-library-source.c	14 Jul 2006 12:43:58 -0000
@@ -1225,7 +1225,7 @@ rb_library_source_add_child_source (cons
 	rhythmdb_query_free (query);
 
 	g_object_get (G_OBJECT (library_source), "icon", &icon, NULL);
-	g_object_set (G_OBJECT (source), "icon", g_object_ref (icon), NULL);
+	g_object_set (G_OBJECT (source), "icon", icon, NULL);
 
 	rb_shell_append_source (shell, source, RB_SOURCE (library_source));
 	library_source->priv->child_sources = g_list_prepend (library_source->priv->child_sources, source);
Index: sources/rb-play-queue-source.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-play-queue-source.c,v
retrieving revision 1.15
diff -p -u -r1.15 rb-play-queue-source.c
--- sources/rb-play-queue-source.c	14 Jul 2006 12:31:33 -0000	1.15
+++ sources/rb-play-queue-source.c	14 Jul 2006 12:43:58 -0000
@@ -18,11 +18,12 @@
  *
  */
 
-#include <config.h>
+#include "config.h"
+
+#include <libxml/tree.h>
+#include <glib/gi18n.h>
 #include <gtk/gtk.h>
-#include <libgnome/gnome-i18n.h>
 #include <libgnomevfs/gnome-vfs-uri.h>
-#include <libxml/tree.h>
 
 #include "rb-play-queue-source.h"
 #include "rb-playlist-xml.h"
@@ -41,9 +42,6 @@ static void rb_play_queue_source_track_i
 							    GtkTreeModel *tree_model,
 							    GtkTreeIter *iter,
 							    RBPlaylistSource *source);
-static void rb_play_queue_sync_playing_state (GObject *entry_view,
-					      GParamSpec *pspec,
-					      RBPlayQueueSource *source);
 static void rb_play_queue_source_row_inserted_cb (GtkTreeModel *model,
 						  GtkTreePath *path,
 						  GtkTreeIter *iter,
@@ -94,6 +92,17 @@ static GtkActionEntry rb_play_queue_sour
 };
 
 static void
+rb_play_queue_sync_playing_state (GObject *entry_view,
+				  GParamSpec *pspec,
+				  RBPlayQueueSource *source)
+{
+	int state;
+	RBPlayQueueSourcePrivate *priv = RB_PLAY_QUEUE_SOURCE_GET_PRIVATE (source);
+	g_object_get (entry_view, "playing-state", &state, NULL);
+	rb_entry_view_set_state (priv->sidebar, state);
+}
+
+static void
 rb_play_queue_source_class_init (RBPlayQueueSourceClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -305,17 +314,6 @@ rb_play_queue_source_track_info_cell_dat
 
 	g_object_set (G_OBJECT (renderer), "markup", markup, NULL);
 	g_free (markup);
-}
-
-static void
-rb_play_queue_sync_playing_state (GObject *entry_view,
-				  GParamSpec *pspec,
-				  RBPlayQueueSource *source)
-{
-	int state;
-	RBPlayQueueSourcePrivate *priv = RB_PLAY_QUEUE_SOURCE_GET_PRIVATE (source);
-	g_object_get (entry_view, "playing-state", &state, NULL);
-	rb_entry_view_set_state (priv->sidebar, state);
 }
 
 static void
Index: sources/rb-playlist-source.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-playlist-source.c,v
retrieving revision 1.124
diff -p -u -r1.124 rb-playlist-source.c
--- sources/rb-playlist-source.c	14 Jul 2006 12:31:33 -0000	1.124
+++ sources/rb-playlist-source.c	14 Jul 2006 12:43:59 -0000
@@ -227,7 +227,6 @@ rb_playlist_source_constructor (GType ty
 
 	source->priv->songs = rb_entry_view_new (source->priv->db, shell_player,
 					 	 NULL, TRUE, TRUE);
-
 	rb_playlist_source_set_query_model (source, rhythmdb_query_model_new_empty (source->priv->db));
 
 	{
Index: sources/rb-podcast-source.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-podcast-source.c,v
retrieving revision 1.71
diff -p -u -r1.71 rb-podcast-source.c
--- sources/rb-podcast-source.c	14 Jul 2006 12:31:33 -0000	1.71
+++ sources/rb-podcast-source.c	14 Jul 2006 12:44:00 -0000
@@ -421,6 +421,8 @@ rb_podcast_source_dispose (GObject *obje
 		return;
 
 	source->priv->disposed = TRUE;
+
+	G_OBJECT_CLASS (rb_podcast_source_parent_class)->dispose (object);
 }
 
 static void
@@ -437,6 +439,7 @@ rb_podcast_source_finalize (GObject *obj
 
 	rb_debug ("finalizing podcast source");
 
+	g_object_unref (source->priv->feeds);
 	g_object_unref (source->priv->podcast_mg);
 
 	if (source->priv->selected_feeds) {
@@ -540,6 +543,7 @@ rb_podcast_source_constructor (GType typ
 						 rb_shell_get_player (shell),
 						 CONF_STATE_PODCAST_SORTING_POSTS,
 						 TRUE, FALSE);
+
 	g_signal_connect_object (G_OBJECT (source->priv->posts),
 				 "entry-activated",
 				 G_CALLBACK (rb_podcast_source_entry_activated_cb),
@@ -1856,11 +1860,14 @@ static void rb_podcast_source_entry_acti
 static gboolean
 impl_can_add_to_queue (RBSource *source)
 {
-	RBEntryView *songs = rb_source_get_entry_view (source);
-	GList *selection = rb_entry_view_get_selected_entries (songs);
+	RBEntryView *songs;
+	GList *selection;
 	GList *iter;
 	gboolean ok = FALSE;
 
+	songs = rb_source_get_entry_view (source);
+	selection = rb_entry_view_get_selected_entries (songs);
+
 	if (selection == NULL)
 		return FALSE;
 
@@ -1879,9 +1886,12 @@ impl_can_add_to_queue (RBSource *source)
 static void
 impl_add_to_queue (RBSource *source, RBSource *queue)
 {
-	RBEntryView *songs = rb_source_get_entry_view (source);
-	GList *selection = rb_entry_view_get_selected_entries (songs);
+	RBEntryView *songs;
+	GList *selection;
 	GList *iter;
+
+	songs = rb_source_get_entry_view (source);
+	selection = rb_entry_view_get_selected_entries (songs);
 
 	if (selection == NULL)
 		return;
Index: sources/rb-source.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-source.c,v
retrieving revision 1.73
diff -p -u -r1.73 rb-source.c
--- sources/rb-source.c	12 Jul 2006 23:30:07 -0000	1.73
+++ sources/rb-source.c	14 Jul 2006 12:44:01 -0000
@@ -394,14 +394,15 @@ rb_source_set_property (GObject *object,
 		break;
 	case PROP_QUERY_MODEL:
 		model = g_value_get_object (value);
+
 		if (priv->query_model == model)
 			return;
 
 		if (priv->query_model) {
-			g_signal_handlers_disconnect_by_func (G_OBJECT (model),
+			g_signal_handlers_disconnect_by_func (G_OBJECT (priv->query_model),
 							      G_CALLBACK (rb_source_post_entry_deleted_cb),
 							      source);
-			g_signal_handlers_disconnect_by_func (G_OBJECT (model),
+			g_signal_handlers_disconnect_by_func (G_OBJECT (priv->query_model),
 							      G_CALLBACK (rb_source_row_inserted_cb),
 							      source);
 			g_object_unref (G_OBJECT (priv->query_model));
Index: sources/rb-sourcelist.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-sourcelist.c,v
retrieving revision 1.39
diff -p -u -r1.39 rb-sourcelist.c
--- sources/rb-sourcelist.c	14 Jul 2006 12:31:34 -0000	1.39
+++ sources/rb-sourcelist.c	14 Jul 2006 12:44:01 -0000
@@ -349,7 +349,7 @@ rb_sourcelist_append (RBSourceList *sour
 		      RBSource *parent)
 {
 	GtkTreeIter iter;
-	PangoAttrList *attrs = pango_attr_list_new ();
+	PangoAttrList *attrs;
 	const char *name;
 	GdkPixbuf *pixbuf;
 	gboolean visible;
@@ -419,10 +419,15 @@ rb_sourcelist_append (RBSourceList *sour
 			rb_debug ("inserting source %p in group %d", source, group);
 			gtk_tree_model_get_iter (sourcelist->priv->real_model, &group_iter, group_path);
 		}
+
 		gtk_tree_store_insert_before (GTK_TREE_STORE (sourcelist->priv->real_model),
 					      &iter, NULL, &group_iter);
+
+		gtk_tree_path_free (group_path);
 	}
 
+	attrs = pango_attr_list_new ();
+
 	gtk_tree_store_set (GTK_TREE_STORE (sourcelist->priv->real_model), &iter,
 			    RB_SOURCELIST_MODEL_COLUMN_PIXBUF, pixbuf,
 			    RB_SOURCELIST_MODEL_COLUMN_NAME, name,
@@ -430,6 +435,8 @@ rb_sourcelist_append (RBSourceList *sour
 			    RB_SOURCELIST_MODEL_COLUMN_ATTRIBUTES, attrs,
 			    RB_SOURCELIST_MODEL_COLUMN_VISIBILITY, visible,
 			    -1);
+
+	pango_attr_list_unref (attrs);
 
 	if (pixbuf != NULL) {
 		g_object_unref (pixbuf);
Index: sources/rb-static-playlist-source.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/sources/rb-static-playlist-source.c,v
retrieving revision 1.25
diff -p -u -r1.25 rb-static-playlist-source.c
--- sources/rb-static-playlist-source.c	14 Jul 2006 12:31:34 -0000	1.25
+++ sources/rb-static-playlist-source.c	14 Jul 2006 12:44:02 -0000
@@ -231,6 +231,7 @@ rb_static_playlist_source_constructor (G
 	gtk_container_remove (GTK_CONTAINER (source), GTK_WIDGET (songs));
 	gtk_paned_pack2 (GTK_PANED (priv->paned), GTK_WIDGET (songs), TRUE, FALSE);
 	gtk_container_add (GTK_CONTAINER (source), priv->paned);
+	g_object_unref (songs);
 
 	/* watch these to find out when things are dropped into the entry view */
 	g_signal_connect_object (G_OBJECT (priv->base_model), "row-inserted",
@@ -277,6 +278,7 @@ rb_static_playlist_source_load_from_xml 
 		location = xmlNodeGetContent (child);
 		rb_static_playlist_source_add_location (source,
 						        (char *) location, -1);
+		xmlFree (location);
 	}
 }
 
Index: widgets/bacon-volume.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/widgets/bacon-volume.c,v
retrieving revision 1.4
diff -p -u -r1.4 bacon-volume.c
--- widgets/bacon-volume.c	14 Jul 2006 12:32:00 -0000	1.4
+++ widgets/bacon-volume.c	14 Jul 2006 12:44:03 -0000
@@ -598,6 +598,9 @@ bacon_volume_scale_value_changed (GtkRan
   gtk_icon_size_lookup (button->size, &w, &h);
   buf = gtk_icon_theme_load_icon (button->theme, s, w, 0, NULL);
   gtk_image_set_from_pixbuf (GTK_IMAGE (button->image), buf);
+  if (buf != NULL) {
+    g_object_unref (buf);
+  }
 #endif
 
   /* signal */
Index: widgets/rb-entry-view.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/widgets/rb-entry-view.c,v
retrieving revision 1.150
diff -p -u -r1.150 rb-entry-view.c
--- widgets/rb-entry-view.c	14 Jul 2006 12:32:00 -0000	1.150
+++ widgets/rb-entry-view.c	14 Jul 2006 12:44:04 -0000
@@ -137,7 +137,6 @@ struct RBEntryViewPrivate
 	gboolean is_drag_source;
 	gboolean is_drag_dest;
 
-	GdkPixbuf *playing_col_pixbuf;
 	GdkPixbuf *playing_pixbuf;
 	GdkPixbuf *paused_pixbuf;
 	GdkPixbuf *error_pixbuf;
@@ -359,18 +358,12 @@ rb_entry_view_class_init (RBEntryViewCla
 static void
 rb_entry_view_init (RBEntryView *view)
 {
-	GtkIconTheme* icon_theme;
+	GtkIconTheme *icon_theme;
 
 	view->priv = RB_ENTRY_VIEW_GET_PRIVATE (view);
 
 	icon_theme = gtk_icon_theme_get_default ();
 
-	view->priv->playing_col_pixbuf = gtk_icon_theme_load_icon (icon_theme,
-                                   			       "stock_volume-max",
-                                   			       16,
-                                   			       0,
-                                   			       NULL);
-
 	view->priv->playing_pixbuf = gtk_icon_theme_load_icon (icon_theme,
                                    			       "stock_media-play",
                                    			       16,
@@ -418,14 +411,13 @@ rb_entry_view_finalize (GObject *object)
 
 	if (view->priv->playing_pixbuf)
 		g_object_unref (G_OBJECT (view->priv->playing_pixbuf));
-	if (view->priv->playing_col_pixbuf)
-		g_object_unref (G_OBJECT (view->priv->playing_col_pixbuf));
 	if (view->priv->paused_pixbuf)
 		g_object_unref (G_OBJECT (view->priv->paused_pixbuf));
 	if (view->priv->error_pixbuf)
 		g_object_unref (G_OBJECT (view->priv->error_pixbuf));
 
 	g_free (view->priv->sorting_key);
+	g_free (view->priv->sorting_column_name);
 
 	G_OBJECT_CLASS (rb_entry_view_parent_class)->finalize (object);
 }
@@ -1118,6 +1110,8 @@ rb_entry_view_append_column (RBEntryView
 		gtk_tree_view_column_pack_start (column, renderer, TRUE);
 		gtk_tree_view_column_set_cell_data_func (column, renderer,
 							 cell_data_func, cell_data, g_free);
+	} else {
+		g_free (cell_data);
 	}
 
 	/*
@@ -1291,9 +1285,7 @@ rb_entry_view_constructor (GType type, g
 							 view,
 							 NULL);
 
-		image_widget = gtk_image_new_from_pixbuf (view->priv->playing_col_pixbuf);
-		g_object_ref (G_OBJECT (image_widget));
-		gtk_object_sink (GTK_OBJECT (image_widget));
+		image_widget = gtk_image_new_from_icon_name ("stock_volume-max", GTK_ICON_SIZE_MENU);
 		gtk_tree_view_column_set_widget (column, image_widget);
 		gtk_widget_show (image_widget);
 
Index: widgets/rb-song-info.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/widgets/rb-song-info.c,v
retrieving revision 1.66
diff -p -u -r1.66 rb-song-info.c
--- widgets/rb-song-info.c	14 Jul 2006 12:32:01 -0000	1.66
+++ widgets/rb-song-info.c	14 Jul 2006 12:44:05 -0000
@@ -502,12 +502,23 @@ rb_song_info_set_property (GObject *obje
 	{
 	case PROP_SOURCE:
 	{
-		RhythmDB* old_db = song_info->priv->db;
+		RhythmDB *old_db = song_info->priv->db;
+
+		if (song_info->priv->source != NULL) {
+			g_signal_handlers_disconnect_by_func (song_info->priv->source,
+							      rb_song_info_query_model_changed_cb,
+							      song_info);
+			g_object_unref (song_info->priv->source);
+			g_object_unref (song_info->priv->query_model);
+			g_object_unref (song_info->priv->db);
+		}
 
 		song_info->priv->source = g_value_get_object (value);
+
 		g_object_ref (G_OBJECT (song_info->priv->source));
 		g_object_get (G_OBJECT (song_info->priv->source),
 			      "query-model", &song_info->priv->query_model, NULL);
+
 		g_signal_connect_object (G_OBJECT (song_info->priv->source),
 					 "notify::query-model",
 					 G_CALLBACK (rb_song_info_query_model_changed_cb),
@@ -516,24 +527,24 @@ rb_song_info_set_property (GObject *obje
 		g_object_get (G_OBJECT (song_info->priv->query_model), "db",
 			      &song_info->priv->db, NULL);
 
-		if(old_db != song_info->priv->db) {
-			if(song_info->priv->albums) {
-				g_object_unref(song_info->priv->albums);
+		if (old_db != song_info->priv->db) {
+			if (song_info->priv->albums) {
+				g_object_unref (song_info->priv->albums);
 			}
-			if(song_info->priv->artists) {
-				g_object_unref(song_info->priv->artists);
+			if (song_info->priv->artists) {
+				g_object_unref (song_info->priv->artists);
 			}
-			if(song_info->priv->genres) {
-				g_object_unref(song_info->priv->genres);
+			if (song_info->priv->genres) {
+				g_object_unref (song_info->priv->genres);
 			}
 
-			song_info->priv->albums  = rhythmdb_property_model_new(song_info->priv->db, RHYTHMDB_PROP_ALBUM);
-			song_info->priv->artists = rhythmdb_property_model_new(song_info->priv->db, RHYTHMDB_PROP_ARTIST);
-			song_info->priv->genres  = rhythmdb_property_model_new(song_info->priv->db, RHYTHMDB_PROP_GENRE);
-
-			g_object_set(song_info->priv->albums,  "query-model", song_info->priv->query_model, NULL);
-			g_object_set(song_info->priv->artists, "query-model", song_info->priv->query_model, NULL);
-			g_object_set(song_info->priv->genres,  "query-model", song_info->priv->query_model, NULL);
+			song_info->priv->albums  = rhythmdb_property_model_new (song_info->priv->db, RHYTHMDB_PROP_ALBUM);
+			song_info->priv->artists = rhythmdb_property_model_new (song_info->priv->db, RHYTHMDB_PROP_ARTIST);
+			song_info->priv->genres  = rhythmdb_property_model_new (song_info->priv->db, RHYTHMDB_PROP_GENRE);
+
+			g_object_set (song_info->priv->albums,  "query-model", song_info->priv->query_model, NULL);
+			g_object_set (song_info->priv->artists, "query-model", song_info->priv->query_model, NULL);
+			g_object_set (song_info->priv->genres,  "query-model", song_info->priv->query_model, NULL);
 
 			if(song_info->priv->album) {
 				GtkEntryCompletion* comp = gtk_entry_get_completion (GTK_ENTRY (song_info->priv->album));
