aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-06-06 02:45:36 +0100
committerJustin Clark-Casey (justincc)2012-06-06 02:45:36 +0100
commitabf94627f6752c81eec6ebe0412bdcb725a66037 (patch)
tree8685020294a91d2926b8d3ec9f94531cc8a67707 /OpenSim
parentStop accidentally reading 4 Int16s instead of 2 in SIZE section of Terragen f... (diff)
downloadopensim-SC_OLD-abf94627f6752c81eec6ebe0412bdcb725a66037.zip
opensim-SC_OLD-abf94627f6752c81eec6ebe0412bdcb725a66037.tar.gz
opensim-SC_OLD-abf94627f6752c81eec6ebe0412bdcb725a66037.tar.bz2
opensim-SC_OLD-abf94627f6752c81eec6ebe0412bdcb725a66037.tar.xz
Ensure closure of bitmap and memory stream with using() statements in WorldViewModule.
If this has any effect then it will only be to the map images returned via requests to the /worldview simulator HTTP path (not enabled by default)
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs15
1 files changed, 8 insertions, 7 deletions
diff --git a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs
index 48c242d..1aee39a 100644
--- a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs
+++ b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs
@@ -113,14 +113,15 @@ namespace OpenSim.Region.OptionalModules.World.WorldView
113 if (!m_Enabled) 113 if (!m_Enabled)
114 return new Byte[0]; 114 return new Byte[0];
115 115
116 Bitmap bmp = m_Generator.CreateViewImage(pos, rot, fov, width, 116 using (Bitmap bmp = m_Generator.CreateViewImage(pos, rot, fov, width, height, usetex))
117 height, usetex); 117 {
118 118 using (MemoryStream str = new MemoryStream())
119 MemoryStream str = new MemoryStream(); 119 {
120 120 bmp.Save(str, ImageFormat.Jpeg);
121 bmp.Save(str, ImageFormat.Jpeg);
122 121
123 return str.ToArray(); 122 return str.ToArray();
123 }
124 }
124 } 125 }
125 } 126 }
126} 127}