diff options
author | Oren Hurvitz | 2014-06-01 17:39:11 +0300 |
---|---|---|
committer | Justin Clark-Casey | 2014-08-02 00:55:57 +0100 |
commit | e41e52e09727842d990a31e2a5f7f3e9c88fe8b3 (patch) | |
tree | 5779c9f42cd913f63e2d237b5a407214933585db /OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |
parent | Add code to GridService to check for overlapping of varregions (diff) | |
download | opensim-SC_OLD-e41e52e09727842d990a31e2a5f7f3e9c88fe8b3.zip opensim-SC_OLD-e41e52e09727842d990a31e2a5f7f3e9c88fe8b3.tar.gz opensim-SC_OLD-e41e52e09727842d990a31e2a5f7f3e9c88fe8b3.tar.bz2 opensim-SC_OLD-e41e52e09727842d990a31e2a5f7f3e9c88fe8b3.tar.xz |
Close streams immediately when we finish using them
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index e9c6fb6..c8056d4 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -918,17 +918,18 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
918 | { | 918 | { |
919 | ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>(); | 919 | ITerrainModule terrainModule = scene.RequestModuleInterface<ITerrainModule>(); |
920 | 920 | ||
921 | MemoryStream ms = new MemoryStream(data); | 921 | using (MemoryStream ms = new MemoryStream(data)) |
922 | if (m_displacement != Vector3.Zero || m_rotation != 0f) | ||
923 | { | 922 | { |
924 | Vector2 rotationCenter = new Vector2(m_rotationCenter.X, m_rotationCenter.Y); | 923 | if (m_displacement != Vector3.Zero || m_rotation != 0f) |
925 | terrainModule.LoadFromStream(terrainPath, m_displacement, m_rotation, rotationCenter, ms); | 924 | { |
926 | } | 925 | Vector2 rotationCenter = new Vector2(m_rotationCenter.X, m_rotationCenter.Y); |
927 | else | 926 | terrainModule.LoadFromStream(terrainPath, m_displacement, m_rotation, rotationCenter, ms); |
928 | { | 927 | } |
929 | terrainModule.LoadFromStream(terrainPath, ms); | 928 | else |
929 | { | ||
930 | terrainModule.LoadFromStream(terrainPath, ms); | ||
931 | } | ||
930 | } | 932 | } |
931 | ms.Close(); | ||
932 | 933 | ||
933 | m_log.DebugFormat("[ARCHIVER]: Restored terrain {0}", terrainPath); | 934 | m_log.DebugFormat("[ARCHIVER]: Restored terrain {0}", terrainPath); |
934 | 935 | ||