[banshee/stable-1.6] [Dap.Ipod] Fix a race condition



commit f8f65c2973c5d22abbdc11c89c98656b306705bb
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Thu Apr 22 09:58:40 2010 +1000

    [Dap.Ipod] Fix a race condition
    
    Signed-off-by: Alexander Kojevnikov <alexander kojevnikov com>

 .../Banshee.Dap.Ipod/IpodSource.cs                 |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs b/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs
index 9a989c7..97b6ee5 100644
--- a/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs
+++ b/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs
@@ -602,7 +602,11 @@ namespace Banshee.Dap.Ipod
 
             if (SupportsPlaylists) {
                 // Add playlists from Banshee to the device
-                foreach (Source child in Children) {
+                List<Source> children = null;
+                lock (Children) {
+                    children = new List<Source> (Children);
+                }
+                foreach (Source child in children) {
                     PlaylistSource from = child as PlaylistSource;
                     if (from != null && from.Count > 0) {
                         IPod.Playlist playlist = ipod_device.TrackDatabase.CreatePlaylist (from.Name);



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