From 29a4614529bbda02b9c690d2d1812be1d1e7bbae Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Sun, 4 Oct 2009 13:57:51 -0700 Subject: * MySQL data tests now pass by fixing a bad fix for a bad cast on the asset Local member in MySQLAssetData * First pass at applying the using(){} pattern to IDisposable objects. Always use the using pattern on IDisposable objects whenever possible, do not manually call .Close() or .Dispose() unless there is no other way to write the code. This pass mostly covers OpenSim.Data.MySQL, and should have no functional change (tests still pass) --- OpenSim/Data/MSSQL/AutoClosingSqlCommand.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'OpenSim/Data/MSSQL/AutoClosingSqlCommand.cs') diff --git a/OpenSim/Data/MSSQL/AutoClosingSqlCommand.cs b/OpenSim/Data/MSSQL/AutoClosingSqlCommand.cs index 93e48cd..0e21880 100644 --- a/OpenSim/Data/MSSQL/AutoClosingSqlCommand.cs +++ b/OpenSim/Data/MSSQL/AutoClosingSqlCommand.cs @@ -197,20 +197,11 @@ namespace OpenSim.Data.MSSQL public void Dispose() { SqlConnection conn = realCommand.Connection; - try - { - realCommand.Dispose(); - } + try { realCommand.Dispose(); } finally { - try - { - conn.Close(); - } - finally - { - conn.Dispose(); - } + try { conn.Dispose(); } + finally { } } } -- cgit v1.1