aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/AutoClosingSqlCommand.cs
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-04 13:57:51 -0700
committerJohn Hurliman2009-10-04 13:57:51 -0700
commit29a4614529bbda02b9c690d2d1812be1d1e7bbae (patch)
tree89725829b37d502158a114c862a56a075b005b1b /OpenSim/Data/MSSQL/AutoClosingSqlCommand.cs
parentGuarding a line that is sometimes throwing a null pointer exception. (diff)
downloadopensim-SC_OLD-29a4614529bbda02b9c690d2d1812be1d1e7bbae.zip
opensim-SC_OLD-29a4614529bbda02b9c690d2d1812be1d1e7bbae.tar.gz
opensim-SC_OLD-29a4614529bbda02b9c690d2d1812be1d1e7bbae.tar.bz2
opensim-SC_OLD-29a4614529bbda02b9c690d2d1812be1d1e7bbae.tar.xz
* 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)
Diffstat (limited to 'OpenSim/Data/MSSQL/AutoClosingSqlCommand.cs')
-rw-r--r--OpenSim/Data/MSSQL/AutoClosingSqlCommand.cs15
1 files changed, 3 insertions, 12 deletions
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
197 public void Dispose() 197 public void Dispose()
198 { 198 {
199 SqlConnection conn = realCommand.Connection; 199 SqlConnection conn = realCommand.Connection;
200 try 200 try { realCommand.Dispose(); }
201 {
202 realCommand.Dispose();
203 }
204 finally 201 finally
205 { 202 {
206 try 203 try { conn.Dispose(); }
207 { 204 finally { }
208 conn.Close();
209 }
210 finally
211 {
212 conn.Dispose();
213 }
214 } 205 }
215 } 206 }
216 207