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/ArchiveWriteRequest.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/ArchiveWriteRequest.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs index 136a16e..448147a 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs | |||
@@ -569,10 +569,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
569 | string terrainPath = String.Format("{0}{1}{2}.r32", | 569 | string terrainPath = String.Format("{0}{1}{2}.r32", |
570 | regionDir, ArchiveConstants.TERRAINS_PATH, scene.RegionInfo.RegionName); | 570 | regionDir, ArchiveConstants.TERRAINS_PATH, scene.RegionInfo.RegionName); |
571 | 571 | ||
572 | MemoryStream ms = new MemoryStream(); | 572 | using (MemoryStream ms = new MemoryStream()) |
573 | scene.RequestModuleInterface<ITerrainModule>().SaveToStream(terrainPath, ms); | 573 | { |
574 | m_archiveWriter.WriteFile(terrainPath, ms.ToArray()); | 574 | scene.RequestModuleInterface<ITerrainModule>().SaveToStream(terrainPath, ms); |
575 | ms.Close(); | 575 | m_archiveWriter.WriteFile(terrainPath, ms.ToArray()); |
576 | } | ||
576 | 577 | ||
577 | m_log.InfoFormat("[ARCHIVER]: Adding scene objects to archive."); | 578 | m_log.InfoFormat("[ARCHIVER]: Adding scene objects to archive."); |
578 | 579 | ||