[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-patches
Subject:    [Mono-patches] r150590 - trunk/mcs/class/System/System.Net.Sockets
From:       "Carlos Alberto Cortes (calberto.cortez () gmail ! com)"
Date:       2010-01-30 2:26:30
Message-ID: 20100130022630.AEAA49472C () mono-cvs ! ximian ! com
[Download RAW message or body]

Author: calberto
Date: 2010-01-29 21:26:30 -0500 (Fri, 29 Jan 2010)
New Revision: 150590

Modified:
   trunk/mcs/class/System/System.Net.Sockets/ChangeLog
   trunk/mcs/class/System/System.Net.Sockets/NetworkStream.cs
Log:
2010-01-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>

	* NetworkStream.cs: Our explicit impl of IDisposable.Dispose belongs
	to 1.0/1.1 only. Also move the call to GC.SupressFinalize to
	Dispose(bool), as expected and as done by other Stream children
	implementing a destructor.
	Fixes #564637.



Modified: trunk/mcs/class/System/System.Net.Sockets/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.Net.Sockets/ChangeLog	2010-01-30 02:19:35 UTC (rev 150589)
+++ trunk/mcs/class/System/System.Net.Sockets/ChangeLog	2010-01-30 02:26:30 UTC (rev 150590)
@@ -1,3 +1,11 @@
+2010-01-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+	* NetworkStream.cs: Our explicit impl of IDisposable.Dispose belongs
+	to 1.0/1.1 only. Also move the call to GC.SupressFinalize to
+	Dispose(bool), as expected and as done by other Stream children
+	implementing a destructor.
+	Fixes #564637.
+
 2010-01-21  Sebastien Pouliot  <sebastien@ximian.com>
 
 	* SocketAsyncEventArgs.cs: Apply Gendarme's ProtectCallToEventDelegatesRule

Modified: trunk/mcs/class/System/System.Net.Sockets/NetworkStream.cs
===================================================================
--- trunk/mcs/class/System/System.Net.Sockets/NetworkStream.cs	2010-01-30 02:19:35 UTC (rev 150589)
+++ trunk/mcs/class/System/System.Net.Sockets/NetworkStream.cs	2010-01-30 02:26:30 UTC (rev 150590)
@@ -303,6 +303,9 @@
 			}
 			socket = null;
 			access = 0;
+
+			if (disposing)
+				GC.SuppressFinalize (this);
 		}
 
 		public override int EndRead (IAsyncResult ar)
@@ -339,11 +342,12 @@
 			// network streams are non-buffered, this is a no-op
 		}
 
+#if !NET_2_0
 		void IDisposable.Dispose ()
 		{
 			Dispose (true);
-			GC.SuppressFinalize (this);
 		}
+#endif
 
 		public override int Read ([In,Out] byte [] buffer, int offset, int size)
 		{

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic