Close streams immediately when we finish using them

This commit is contained in:
Oren Hurvitz
2014-06-01 17:39:11 +03:00
parent b81187db5a
commit 99ac770abb
34 changed files with 426 additions and 485 deletions

View File

@@ -315,7 +315,7 @@ namespace OpenSim.Server.Handlers.UserAccounts
rootElement.AppendChild(result);
return DocToBytes(doc);
return Util.DocToBytes(doc);
}
private byte[] FailureResult()
@@ -337,18 +337,7 @@ namespace OpenSim.Server.Handlers.UserAccounts
rootElement.AppendChild(result);
return DocToBytes(doc);
}
private byte[] DocToBytes(XmlDocument doc)
{
MemoryStream ms = new MemoryStream();
XmlTextWriter xw = new XmlTextWriter(ms, null);
xw.Formatting = Formatting.Indented;
doc.WriteTo(xw);
xw.Flush();
return ms.ToArray();
return Util.DocToBytes(doc);
}
private byte[] ResultToBytes(Dictionary<string, object> result)