From 881e92a7260a5823867b8f93b88c1b706a13cb56 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 20 Jun 2012 00:19:50 +0100 Subject: [PATCH] Raise some IO associated Exception logging in XEngine to error level, in line with other similar cases. Remove more unnecessary Close() calls - these are being triggered by the Dispose() called when exiting the using statement for these sdk io objects. --- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 3f623de3b2..35b58ee195 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -1715,14 +1715,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine FileMode.Open, FileAccess.Read)) { tfs.Read(tdata, 0, tdata.Length); - tfs.Close(); } assem = new System.Text.ASCIIEncoding().GetString(tdata); } catch (Exception e) { - m_log.DebugFormat("[XEngine]: Unable to open script textfile {0}, reason: {1}", assemName+".text", e.Message); + m_log.ErrorFormat( + "[XEngine]: Unable to open script textfile {0}{1}, reason: {2}", + assemName, ".text", e.Message); } } } @@ -1739,16 +1740,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine using (FileStream fs = File.Open(assemName, FileMode.Open, FileAccess.Read)) { fs.Read(data, 0, data.Length); - fs.Close(); } assem = System.Convert.ToBase64String(data); } catch (Exception e) { - m_log.DebugFormat("[XEngine]: Unable to open script assembly {0}, reason: {1}", assemName, e.Message); + m_log.ErrorFormat( + "[XEngine]: Unable to open script assembly {0}, reason: {1}", assemName, e.Message); } - } } @@ -1761,9 +1761,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine using (StreamReader msr = new StreamReader(mfs)) { map = msr.ReadToEnd(); - msr.Close(); } - mfs.Close(); } }