Author: alanmc
Date: 2007-11-21 19:13:39 -0500 (Wed, 21 Nov 2007)
New Revision: 90117
Modified:
trunk/bitsharp/src/MonoTorrent/Client/Managers/ConnectionManager.cs
Log:
Fix for null ref when removing pending requests
Modified: trunk/bitsharp/src/MonoTorrent/Client/Managers/ConnectionManager.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Client/Managers/ConnectionManager.cs
2007-11-22 00:09:32 UTC (rev 90116)
+++ trunk/bitsharp/src/MonoTorrent/Client/Managers/ConnectionManager.cs
2007-11-22 00:13:39 UTC (rev 90117)
@@ -827,6 +827,11 @@
{
lock (id)
{
+ // It's possible the peer could be in an async send
*and* receive and so end up
+ // in this block twice. This check makes sure we don't
try to double dispose.
+ if (id.Peer.Connection == null)
+ return;
+
Console.WriteLine("Cleaned Up: " + id.Peer.Location);
Logger.Log(id, "Cleanup Reason : " + message);
Logger.FlushToDisk(id);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches