Browse Source

2005-10-04 Sebastien Pouliot <[email protected]>

	* OleDbDataReader.cs: Added a call to GC.SuppressFinalize in Dispose
	method (and avoids calling the destructor if the object was disposed).
	* OleDbTransaction.cs: Added a call to GC.SuppressFinalize in Dispose
	method (even if we throw an NotImplementedException afterward). This
	will remove warnings from gendarme.


svn path=/trunk/mcs/; revision=51228
Sebastien Pouliot 20 years ago
parent
commit
dc60d22be7

+ 8 - 0
mcs/class/System.Data/System.Data.OleDb/ChangeLog

@@ -1,3 +1,11 @@
+2005-10-04  Sebastien Pouliot  <[email protected]>
+
+	* OleDbDataReader.cs: Added a call to GC.SuppressFinalize in Dispose
+	method (and avoids calling the destructor if the object was disposed).
+	* OleDbTransaction.cs: Added a call to GC.SuppressFinalize in Dispose
+	method (even if we throw an NotImplementedException afterward). This
+	will remove warnings from gendarme.
+
 2005-09-20  Alexandre Miguel Pedro Gomes  <[email protected]>
 	
 	* OleDbConnection.cs: Verify and throw an exception if the

+ 4 - 6
mcs/class/System.Data/System.Data.OleDb/OleDbDataReader.cs

@@ -7,10 +7,7 @@
 //
 // Copyright (C) Rodrigo Moya, 2002
 // Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -34,7 +31,6 @@
 
 using System.Collections;
 using System.ComponentModel;
-using System.Data;
 using System.Data.Common;
 using System.Runtime.InteropServices;
 
@@ -683,11 +679,13 @@ namespace System.Data.OleDb
 
 		#region Destructors
 
-		private void Dispose (bool disposing) {
+		private void Dispose (bool disposing)
+		{
 			if (!this.disposed) {
 				if (disposing) {
 					// release any managed resources
 					command = null;
+					GC.SuppressFinalize (this);
 				}
 				// release any unmanaged resources
 				if (gdaResults != null) {

+ 2 - 5
mcs/class/System.Data/System.Data.OleDb/OleDbTransaction.cs

@@ -7,10 +7,7 @@
 //
 // Copyright (C) Rodrigo Moya, 2002
 // Copyright (C) Tim Coleman, 2002
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -32,7 +29,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-using System.Data;
 using System.Data.Common;
 
 namespace System.Data.OleDb
@@ -157,6 +153,7 @@ namespace System.Data.OleDb
 		[MonoTODO]
 		void IDisposable.Dispose ()
 		{
+			GC.SuppressFinalize (this);
 			throw new NotImplementedException ();
 		}