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/Region/Application/Application.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/Application/Application.cs') diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 241af53..33b01e5 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -205,13 +205,10 @@ namespace OpenSim Directory.CreateDirectory(m_crashDir); } string log = Util.GetUniqueFilename(ex.GetType() + ".txt"); - StreamWriter m_crashLog = - new StreamWriter( - Path.Combine(m_crashDir, log) - ); - - m_crashLog.WriteLine(msg); - m_crashLog.Close(); + using (StreamWriter m_crashLog = new StreamWriter(Path.Combine(m_crashDir, log))) + { + m_crashLog.WriteLine(msg); + } File.Copy("OpenSim.ini", Path.Combine(m_crashDir, log + "_OpenSim.ini"), true); } -- cgit v1.1