aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-02-28 00:15:20 +0000
committerJustin Clark-Casey (justincc)2014-02-28 00:16:06 +0000
commit5038a59ef31cdfcf0d1bc1fc61ebdb3728d280c1 (patch)
treeecaf354adb6c7cfdb481c440eab1e43a96a4b07f /OpenSim/Region/CoreModules/World
parentSet up a StreamReader and call ReadToEnd() instead of using the GetStreamStri... (diff)
downloadopensim-SC-5038a59ef31cdfcf0d1bc1fc61ebdb3728d280c1.zip
opensim-SC-5038a59ef31cdfcf0d1bc1fc61ebdb3728d280c1.tar.gz
opensim-SC-5038a59ef31cdfcf0d1bc1fc61ebdb3728d280c1.tar.bz2
opensim-SC-5038a59ef31cdfcf0d1bc1fc61ebdb3728d280c1.tar.xz
Maybe slightly reduce warp3d memory leakage by disposing of decoded bitmap in Warp3DImageModule.GetTexture()
However, this still appears to be leaking massively, at least for me. Possible cause is warp3D using GDI objects internally and not disposing of them.
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r--OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs14
1 files changed, 6 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs
index be328a7..23dee56 100644
--- a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs
@@ -189,6 +189,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
189 } 189 }
190 190
191 WarpRenderer renderer = new WarpRenderer(); 191 WarpRenderer renderer = new WarpRenderer();
192
192 renderer.CreateScene(width, height); 193 renderer.CreateScene(width, height);
193 renderer.Scene.autoCalcNormals = false; 194 renderer.Scene.autoCalcNormals = false;
194 195
@@ -243,9 +244,11 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
243 obj.vertexData = null; 244 obj.vertexData = null;
244 obj.triangleData = null; 245 obj.triangleData = null;
245 } 246 }
247
246 renderer.Scene.removeAllObjects(); 248 renderer.Scene.removeAllObjects();
247 renderer = null; 249 renderer = null;
248 viewport = null; 250 viewport = null;
251
249 m_colors.Clear(); 252 m_colors.Clear();
250 GC.Collect(); 253 GC.Collect();
251 m_log.Debug("[WARP 3D IMAGE MODULE]: GC.Collect()"); 254 m_log.Debug("[WARP 3D IMAGE MODULE]: GC.Collect()");
@@ -637,21 +640,16 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
637 if (asset != null) 640 if (asset != null)
638 { 641 {
639 IJ2KDecoder imgDecoder = m_scene.RequestModuleInterface<IJ2KDecoder>(); 642 IJ2KDecoder imgDecoder = m_scene.RequestModuleInterface<IJ2KDecoder>();
640 Bitmap img = null;
641 643
642 try 644 try
643 { 645 {
644 img = (Bitmap)imgDecoder.DecodeToImage(asset); 646 using (Bitmap img = (Bitmap)imgDecoder.DecodeToImage(asset))
647 ret = new warp_Texture(img);
645 } 648 }
646 catch (Exception e) 649 catch (Exception e)
647 { 650 {
648 m_log.Warn(string.Format("[WARP 3D IMAGE MODULE]: Failed to decode asset {0}, exception ", id), e); 651 m_log.Warn(string.Format("[WARP 3D IMAGE MODULE]: Failed to decode asset {0}, exception ", id), e);
649 } 652 }
650
651 if (img != null)
652 {
653 return new warp_Texture(img);
654 }
655 } 653 }
656 654
657 return ret; 655 return ret;