[rhythmbox] audioscrobbler: remove source's love/ban actions from ui manager on deletion



commit e6c78df84a0744bfb086e712ef6dc92088e01eb6
Author: Jamie Nicol <jamie thenicols net>
Date:   Thu Jul 15 16:33:26 2010 +0100

    audioscrobbler: remove source's love/ban actions from ui manager on deletion
    
    Ensures that when a profile source is deleted then another is created
    attempting to love or ban a track will actually work instead of segfaulting

 .../rb-audioscrobbler-profile-source.c             |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/plugins/audioscrobbler/rb-audioscrobbler-profile-source.c b/plugins/audioscrobbler/rb-audioscrobbler-profile-source.c
index 7b49a81..cd4a340 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler-profile-source.c
+++ b/plugins/audioscrobbler/rb-audioscrobbler-profile-source.c
@@ -1568,6 +1568,7 @@ impl_delete_thyself (RBSource *asource)
 {
 	RBAudioscrobblerProfileSource *source;
 	GList *i;
+	GtkUIManager *ui_manager;
 
 	rb_debug ("deleting profile source");
 
@@ -1576,4 +1577,9 @@ impl_delete_thyself (RBSource *asource)
 	for (i = source->priv->radio_sources; i != NULL; i = i->next) {
 		rb_source_delete_thyself (i->data);
 	}
+
+	g_object_get (source, "ui-manager", &ui_manager, NULL);
+	gtk_ui_manager_remove_action_group (ui_manager, source->priv->action_group);
+
+	g_object_unref (ui_manager);
 }



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