diff options
author | John Hurliman | 2009-10-04 13:57:51 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-04 13:57:51 -0700 |
commit | 29a4614529bbda02b9c690d2d1812be1d1e7bbae (patch) | |
tree | 89725829b37d502158a114c862a56a075b005b1b /OpenSim/Region | |
parent | Guarding a line that is sometimes throwing a null pointer exception. (diff) | |
download | opensim-SC-29a4614529bbda02b9c690d2d1812be1d1e7bbae.zip opensim-SC-29a4614529bbda02b9c690d2d1812be1d1e7bbae.tar.gz opensim-SC-29a4614529bbda02b9c690d2d1812be1d1e7bbae.tar.bz2 opensim-SC-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/Region')
-rw-r--r-- | OpenSim/Region/Application/Application.cs | 11 |
1 files changed, 4 insertions, 7 deletions
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 | |||
205 | Directory.CreateDirectory(m_crashDir); | 205 | Directory.CreateDirectory(m_crashDir); |
206 | } | 206 | } |
207 | string log = Util.GetUniqueFilename(ex.GetType() + ".txt"); | 207 | string log = Util.GetUniqueFilename(ex.GetType() + ".txt"); |
208 | StreamWriter m_crashLog = | 208 | using (StreamWriter m_crashLog = new StreamWriter(Path.Combine(m_crashDir, log))) |
209 | new StreamWriter( | 209 | { |
210 | Path.Combine(m_crashDir, log) | 210 | m_crashLog.WriteLine(msg); |
211 | ); | 211 | } |
212 | |||
213 | m_crashLog.WriteLine(msg); | ||
214 | m_crashLog.Close(); | ||
215 | 212 | ||
216 | File.Copy("OpenSim.ini", Path.Combine(m_crashDir, log + "_OpenSim.ini"), true); | 213 | File.Copy("OpenSim.ini", Path.Combine(m_crashDir, log + "_OpenSim.ini"), true); |
217 | } | 214 | } |