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:
authorPedro Martínez Juliá <pedro@mono-cvs.ximian.com>2003-11-23 20:28:59 +0300
committerPedro Martínez Juliá <pedro@mono-cvs.ximian.com>2003-11-23 20:28:59 +0300
commitcb09b2aa7151b0a867bf1bf3f917106e036d9a72 (patch)
tree7148c55aad07722a410014f7720024bc16b15728 /mcs/class/System.Data/System.Data.Common
parent81ca226d7563e628b29dfad09a55afaadb7eea7a (diff)
2003-11-23 Pedro Mart�nez Juli� <yoros@wanadoo.es>
* DbDataAdapter.cs: Call command dispose in self dispose method. We need to dispose the connections and other stuff stored in the commands. svn path=/trunk/mcs/; revision=20355
Diffstat (limited to 'mcs/class/System.Data/System.Data.Common')
-rwxr-xr-xmcs/class/System.Data/System.Data.Common/ChangeLog6
-rw-r--r--mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs27
2 files changed, 26 insertions, 7 deletions
diff --git a/mcs/class/System.Data/System.Data.Common/ChangeLog b/mcs/class/System.Data/System.Data.Common/ChangeLog
index 7d19f7aa1ae..4fea0c28881 100755
--- a/mcs/class/System.Data/System.Data.Common/ChangeLog
+++ b/mcs/class/System.Data/System.Data.Common/ChangeLog
@@ -1,3 +1,9 @@
+2003-11-23 Pedro Martínez Juliá <yoros@wanadoo.es>
+
+ * DbDataAdapter.cs: Call command dispose in self dispose method. We
+ need to dispose the connections and other stuff stored in the
+ commands.
+
2003-11-10 Pedro Martínez Juliá <yoros@wanadoo.es>
* DataColumnMappingCollection.cs: Fix a missing exception when the
diff --git a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs b/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
index 1b5de338d06..6b199cdbe1e 100644
--- a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
+++ b/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
@@ -77,17 +77,30 @@ namespace System.Data.Common {
protected override void Dispose (bool disposing)
{
if (disposing) {
- ((IDbDataAdapter) this).SelectCommand = null;
- ((IDbDataAdapter) this).InsertCommand = null;
- ((IDbDataAdapter) this).UpdateCommand = null;
- ((IDbDataAdapter) this).DeleteCommand = null;
+ IDbDataAdapter da = (IDbDataAdapter) this;
+ if (da.SelectCommand != null) {
+ da.SelectCommand.Dispose();
+ da.SelectCommand = null;
+ }
+ if (da.InsertCommand != null) {
+ da.InsertCommand.Dispose();
+ da.InsertCommand = null;
+ }
+ if (da.UpdateCommand != null) {
+ da.UpdateCommand.Dispose();
+ da.UpdateCommand = null;
+ }
+ if (da.DeleteCommand != null) {
+ da.DeleteCommand.Dispose();
+ da.DeleteCommand = null;
+ }
}
}
- public override int Fill (DataSet dataSet)
- {
+ public override int Fill (DataSet dataSet)
+ {
return Fill (dataSet, 0, 0, DefaultSourceTableName, SelectCommand, CommandBehavior.Default);
- }
+ }
public int Fill (DataTable dataTable)
{