aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-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;