banshee r4666 - in trunk/banshee: . src/Clients/Beroe/Beroe src/Core/Banshee.Services/Banshee.Collection.Indexer



Author: abock
Date: Wed Oct  8 16:43:54 2008
New Revision: 4666
URL: http://svn.gnome.org/viewvc/banshee?rev=4666&view=rev

Log:
* banshee/src/Core/Banshee.Services/Banshee.Collection.Indexer/CollectionIndexer.cs:
  Add a missing lock, which was causing a crash+race

* banshee/src/Clients/Beroe/Beroe/RemoteClient.cs: Add missing call to
  Index so we actually can get results from the server

Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Clients/Beroe/Beroe/RemoteClient.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Indexer/CollectionIndexer.cs

Modified: trunk/banshee/src/Clients/Beroe/Beroe/RemoteClient.cs
==============================================================================
--- trunk/banshee/src/Clients/Beroe/Beroe/RemoteClient.cs	(original)
+++ trunk/banshee/src/Clients/Beroe/Beroe/RemoteClient.cs	Wed Oct  8 16:43:54 2008
@@ -64,12 +64,15 @@
             Sleep (5);
             
             ICollectionIndexer indexer = CreateIndexer ();
+            indexer.Index ();
+            
             for (int i = 0, models = indexer.GetModelCounts (); i < models; i++) {
                 for (int j = 0, items = indexer.GetModelResultsCount (i); j < items; j++) {
                     IDictionary<string, object> result = indexer.GetResult (i, j);
                     Console.WriteLine (result["URI"]);
                 }
             }
+            
             indexer.Dispose ();
             
             lock (shutdown_mutex) {

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Indexer/CollectionIndexer.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Indexer/CollectionIndexer.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Indexer/CollectionIndexer.cs	Wed Oct  8 16:43:54 2008
@@ -72,10 +72,12 @@
         
         public void Dispose ()
         {
-            DisposeModels ();
+            lock (this) {
+                DisposeModels ();
             
-            if (service != null) {
-                service.DisposeIndexer (this);
+                if (service != null) {
+                    service.DisposeIndexer (this);
+                }
             }
         }
         



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