banshee r4230 - trunk/banshee/src/Core/Banshee.Services/Banshee.Sources



Author: blorentz
Date: Sun Jul 20 21:28:34 2008
New Revision: 4230
URL: http://svn.gnome.org/viewvc/banshee?rev=4230&view=rev

Log:
2008-07-20  Bertrand Lorentz  <lorentz siva>

	* src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs: Add a lock 
	statement on the error_source field, to prevent a deadlock when importing
	songs with invalid mpeg headers (BGO #542915). 



Modified:
   trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs	Sun Jul 20 21:28:34 2008
@@ -308,12 +308,14 @@
 
         protected void OnErrorSourceUpdated (object o, EventArgs args)
         {
-            if (error_source.Count > 0 && !error_source_visible) {
-                AddChildSource (error_source);
-                error_source_visible = true;
-            } else if (error_source.Count <= 0 && error_source_visible) {
-                RemoveChildSource (error_source);
-                error_source_visible = false;
+            lock (error_source) {
+                if (error_source.Count > 0 && !error_source_visible) {
+                    error_source_visible = true;
+                    AddChildSource (error_source);
+                } else if (error_source.Count <= 0 && error_source_visible) {
+                    error_source_visible = false;
+                    RemoveChildSource (error_source);
+                }
             }
         }
 



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