aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorUbitUmarov2016-08-24 01:22:50 +0100
committerUbitUmarov2016-08-24 01:22:50 +0100
commit517064121dc301327cda5c9c4ab1b039d0a31e35 (patch)
tree051ca332d91582923023b480652374352464eb16 /OpenSim/Region/CoreModules
parent DynamicTextureModule memory leaks (diff)
downloadopensim-SC-517064121dc301327cda5c9c4ab1b039d0a31e35.zip
opensim-SC-517064121dc301327cda5c9c4ab1b039d0a31e35.tar.gz
opensim-SC-517064121dc301327cda5c9c4ab1b039d0a31e35.tar.bz2
opensim-SC-517064121dc301327cda5c9c4ab1b039d0a31e35.tar.xz
estate handleTerrainRequest memory leaks
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs21
1 files changed, 15 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
index 56d41a8..425562f 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
@@ -1229,15 +1229,24 @@ namespace OpenSim.Region.CoreModules.World.Estate
1229 } 1229 }
1230 terr.SaveToFile(Util.dataDir() + "/terrain.raw"); 1230 terr.SaveToFile(Util.dataDir() + "/terrain.raw");
1231 1231
1232 FileStream input = new FileStream(Util.dataDir() + "/terrain.raw", FileMode.Open); 1232 byte[] bdata;
1233 byte[] bdata = new byte[input.Length]; 1233 using(FileStream input = new FileStream(Util.dataDir() + "/terrain.raw",FileMode.Open))
1234 input.Read(bdata, 0, (int)input.Length); 1234 {
1235 bdata = new byte[input.Length];
1236 input.Read(bdata, 0, (int)input.Length);
1237 }
1238 if(bdata == null || bdata.Length == 0)
1239 {
1240 remote_client.SendAlertMessage("Terrain error");
1241 return;
1242 }
1243
1235 remote_client.SendAlertMessage("Terrain file written, starting download..."); 1244 remote_client.SendAlertMessage("Terrain file written, starting download...");
1236 Scene.XferManager.AddNewFile("terrain.raw", bdata); 1245 string xfername = (UUID.Random()).ToString();
1246 Scene.XferManager.AddNewFile(xfername, bdata);
1237 1247
1238 m_log.DebugFormat("[CLIENT]: Sending terrain for region {0} to {1}", Scene.Name, remote_client.Name); 1248 m_log.DebugFormat("[CLIENT]: Sending terrain for region {0} to {1}", Scene.Name, remote_client.Name);
1239 1249 remote_client.SendInitiateDownload(xfername, clientFileName);
1240 remote_client.SendInitiateDownload("terrain.raw", clientFileName);
1241 } 1250 }
1242 } 1251 }
1243 1252