diff options
author | Justin Clark-Casey (justincc) | 2014-12-03 18:58:55 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-12-03 20:31:09 +0000 |
commit | 72d1d96c5c9b8f9f31e21ef4a3d542a27fc6c3f8 (patch) | |
tree | 90a7eebc4397f2f5abca4c545f7de96f30cabb78 /OpenSim/Region/ScriptEngine/Shared/Instance | |
parent | Fix typo in ini (diff) | |
download | opensim-SC-72d1d96c5c9b8f9f31e21ef4a3d542a27fc6c3f8.zip opensim-SC-72d1d96c5c9b8f9f31e21ef4a3d542a27fc6c3f8.tar.gz opensim-SC-72d1d96c5c9b8f9f31e21ef4a3d542a27fc6c3f8.tar.bz2 opensim-SC-72d1d96c5c9b8f9f31e21ef4a3d542a27fc6c3f8.tar.xz |
Always close script linemap file after reading and always dispose of other streams in the script engine even if exceptions are thrown.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Instance')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 9da2168..637c556 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -1065,10 +1065,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
1065 | { | 1065 | { |
1066 | try | 1066 | try |
1067 | { | 1067 | { |
1068 | FileStream fs = File.Create(Path.Combine(Path.GetDirectoryName(assembly), ItemID.ToString() + ".state")); | 1068 | using (FileStream fs = File.Create(Path.Combine(Path.GetDirectoryName(assembly), ItemID.ToString() + ".state"))) |
1069 | Byte[] buf = Util.UTF8NoBomEncoding.GetBytes(xml); | 1069 | { |
1070 | fs.Write(buf, 0, buf.Length); | 1070 | Byte[] buf = Util.UTF8NoBomEncoding.GetBytes(xml); |
1071 | fs.Close(); | 1071 | fs.Write(buf, 0, buf.Length); |
1072 | } | ||
1072 | } | 1073 | } |
1073 | catch(Exception) | 1074 | catch(Exception) |
1074 | { | 1075 | { |