[banshee/stable-1.6] [TrackActions] Fix collection-modified crash



commit f85326baa08b30924bc2c69446af41eb0da36593
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Sun Apr 25 13:41:19 2010 -0700

    [TrackActions] Fix collection-modified crash
    
    Fixes bgo#615094

 .../Banshee.Gui/TrackActions.cs                    |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs b/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs
index 1d8ebfc..1d0d779 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs
@@ -329,6 +329,11 @@ namespace Banshee.Gui
         {
             Source active_source = ServiceManager.SourceManager.ActiveSource;
 
+            List<Source> children;
+            lock (ActivePrimarySource.Children) {
+                children = new List<Source> (ActivePrimarySource.Children);
+            }
+
             // TODO find just the menu that was activated instead of modifying all proxies
             foreach (Widget proxy_widget in (o as Gtk.Action).Proxies) {
                 MenuItem menu = proxy_widget as MenuItem;
@@ -341,7 +346,7 @@ namespace Banshee.Gui
                 submenu.Append (this ["AddToNewPlaylistAction"].CreateMenuItem ());
                 bool separator_added = false;
 
-                foreach (Source child in ActivePrimarySource.Children) {
+                foreach (Source child in children) {
                     PlaylistSource playlist = child as PlaylistSource;
                     if (playlist != null) {
                         if (!separator_added) {



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