[banshee] [Dap.Ipod] Fix a race condition



commit da674e7b20418f71187a722e936dff844f767ab4
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 1c78638..be602a5 100644
--- a/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs
+++ b/src/Dap/Banshee.Dap.Ipod/Banshee.Dap.Ipod/IpodSource.cs
@@ -605,7 +605,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]