dispose some MemoryStreams

This commit is contained in:
UbitUmarov
2017-05-06 15:57:47 +01:00
parent 025bef4e07
commit ae191cd304
4 changed files with 11 additions and 17 deletions

View File

@@ -215,13 +215,16 @@ namespace OpenSim.Server.Handlers.MapImage
private byte[] DocToBytes(XmlDocument doc)
{
MemoryStream ms = new MemoryStream();
XmlTextWriter xw = new XmlTextWriter(ms, null);
xw.Formatting = Formatting.Indented;
doc.WriteTo(xw);
xw.Flush();
using(MemoryStream ms = new MemoryStream())
{
using(XmlTextWriter xw = new XmlTextWriter(ms,null))
{
xw.Formatting = Formatting.Indented;
doc.WriteTo(xw);
xw.Flush();
}
return ms.ToArray();
}
}
private System.Net.IPAddress GetCallerIP(IOSHttpRequest request)