Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2005-03-12 00:12:45 +0300
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2005-03-12 00:12:45 +0300
commitea1707ac6f0dac5782c993f4b1ada4647e9108cf (patch)
treedbe3512f8b02c2c0bf63bb8f47a9608de016e950 /mcs/class/System.Data/System.Data.SqlClient
parentec84c7c397d9e41455e40df199deb89f946535cf (diff)
2005-03-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* SqlConnection.cs: added a finalizer for correct implementation of the IDisposable pattern. svn path=/trunk/mcs/; revision=41722
Diffstat (limited to 'mcs/class/System.Data/System.Data.SqlClient')
-rwxr-xr-xmcs/class/System.Data/System.Data.SqlClient/ChangeLog5
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs8
2 files changed, 11 insertions, 2 deletions
diff --git a/mcs/class/System.Data/System.Data.SqlClient/ChangeLog b/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
index 00ce4730983..d0730056ba1 100755
--- a/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
+++ b/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
@@ -1,5 +1,10 @@
2005-03-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+ * SqlConnection.cs: added a finalizer for correct implementation of the
+ IDisposable pattern.
+
+2005-03-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
* SqlException.cs: make it serialization-compatible with MS. Patch by
Aleksandar Dezelin. Closes bug #73596.
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs
index 456a6c0a340..e8e223d8e4f 100644
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs
+++ b/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs
@@ -411,11 +411,10 @@ namespace System.Data.SqlClient {
dataSource = ""; // default dataSource
ConnectionString = null;
}
- disposed = true;
} finally {
+ disposed = true;
base.Dispose (disposing);
}
-
}
}
@@ -455,6 +454,11 @@ namespace System.Data.SqlClient {
GC.SuppressFinalize (this);
}
+ ~SqlConnection ()
+ {
+ Dispose (false);
+ }
+
public
#if NET_2_0
override