Author: alanmc
Date: 2008-01-24 18:22:04 -0500 (Thu, 24 Jan 2008)
New Revision: 93857

Modified:
   trunk/bitsharp/tags/version-0.20/MonoTorrent/Client/ClientEngine.cs
   trunk/bitsharp/tags/version-0.20/MonoTorrent/Client/Managers/DiskManager.cs
Log:
Backported fix for Disposing the diskmanager

Modified: trunk/bitsharp/tags/version-0.20/MonoTorrent/Client/ClientEngine.cs
===================================================================
--- trunk/bitsharp/tags/version-0.20/MonoTorrent/Client/ClientEngine.cs 
2008-01-24 22:56:31 UTC (rev 93856)
+++ trunk/bitsharp/tags/version-0.20/MonoTorrent/Client/ClientEngine.cs 
2008-01-24 23:22:04 UTC (rev 93857)
@@ -252,6 +252,7 @@
                     Unregister(t);
                     t.Dispose();
                 }
+                this.diskManager.Dispose();
             }
 
             lock (asyncCompletionLock)

Modified: 
trunk/bitsharp/tags/version-0.20/MonoTorrent/Client/Managers/DiskManager.cs
===================================================================
--- trunk/bitsharp/tags/version-0.20/MonoTorrent/Client/Managers/DiskManager.cs 
2008-01-24 22:56:31 UTC (rev 93856)
+++ trunk/bitsharp/tags/version-0.20/MonoTorrent/Client/Managers/DiskManager.cs 
2008-01-24 23:22:04 UTC (rev 93857)
@@ -9,7 +9,7 @@
 
 namespace MonoTorrent.Client.Managers
 {
-    public class DiskManager
+    public class DiskManager : IDisposable
     {
         #region Member Variables
 
@@ -108,17 +108,6 @@
 
 
         /// <summary>
-        /// Disposes all necessary objects
-        /// </summary>
-        internal void Dispose()
-        {
-            ioActive = false;
-            threadWait.Set();
-            streamsBuffer.Dispose();
-        }
-
-
-        /// <summary>
         /// Generates the full path to the supplied TorrentFile
         /// </summary>
         /// <param name="file">The TorrentFile to generate the full path 
to</param>
@@ -419,5 +408,13 @@
         }
 
         #endregion
+
+        public void Dispose()
+        {
+            ioActive = false;
+            this.threadWait.Set();
+            this.ioThread.Join();
+            this.streamsBuffer.Dispose();
+        }
     }
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to