mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
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)
This commit is contained in:
@@ -113,14 +113,15 @@ namespace OpenSim.Region.OptionalModules.World.WorldView
|
||||
if (!m_Enabled)
|
||||
return new Byte[0];
|
||||
|
||||
Bitmap bmp = m_Generator.CreateViewImage(pos, rot, fov, width,
|
||||
height, usetex);
|
||||
using (Bitmap bmp = m_Generator.CreateViewImage(pos, rot, fov, width, height, usetex))
|
||||
{
|
||||
using (MemoryStream str = new MemoryStream())
|
||||
{
|
||||
bmp.Save(str, ImageFormat.Jpeg);
|
||||
|
||||
MemoryStream str = new MemoryStream();
|
||||
|
||||
bmp.Save(str, ImageFormat.Jpeg);
|
||||
|
||||
return str.ToArray();
|
||||
return str.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user