Author: gonzalo
Date: 2005-03-11 16:12:45 -0500 (Fri, 11 Mar 2005)
New Revision: 41722

Modified:
   trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
   trunk/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs
Log:
2005-03-11 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>

        * SqlConnection.cs: added a finalizer for correct implementation of the
        IDisposable pattern.



Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog 2005-03-11 
21:11:27 UTC (rev 41721)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog 2005-03-11 
21:12:45 UTC (rev 41722)
@@ -1,5 +1,10 @@
 2005-03-11 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
+       * SqlConnection.cs: added a finalizer for correct implementation of the
+       IDisposable pattern.
+
+2005-03-11 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
        * SqlException.cs: make it serialization-compatible with MS. Patch by
        Aleksandar Dezelin. Closes bug #73596.
 

Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs  
2005-03-11 21:11:27 UTC (rev 41721)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs  
2005-03-11 21:12:45 UTC (rev 41722)
@@ -411,11 +411,10 @@
                                                 dataSource = ""; // default 
dataSource
                                                 ConnectionString = null;
                                         }
+                                } finally {
                                         disposed = true;
-                                } finally {
                                         base.Dispose (disposing);
                                 }
-                                
                        }
                }
 
@@ -455,6 +454,11 @@
                        GC.SuppressFinalize (this);
                }
 
+               ~SqlConnection ()
+               {
+                       Dispose (false);
+               }
+
                public 
 #if NET_2_0
                override

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to