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)
0.7.4.1
Justin Clark-Casey (justincc) 2012-06-06 02:45:36 +01:00
parent 6adc810eaa
commit abf94627f6
1 changed files with 8 additions and 7 deletions

View File

@ -113,14 +113,15 @@ namespace OpenSim.Region.OptionalModules.World.WorldView
if (!m_Enabled) if (!m_Enabled)
return new Byte[0]; return new Byte[0];
Bitmap bmp = m_Generator.CreateViewImage(pos, rot, fov, width, using (Bitmap bmp = m_Generator.CreateViewImage(pos, rot, fov, width, height, usetex))
height, usetex); {
using (MemoryStream str = new MemoryStream())
MemoryStream str = new MemoryStream(); {
bmp.Save(str, ImageFormat.Jpeg); bmp.Save(str, ImageFormat.Jpeg);
return str.ToArray(); return str.ToArray();
} }
} }
}
}
} }