mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 10:15:33 +08:00
Close streams immediately when we finish using them
This commit is contained in:
@@ -279,7 +279,7 @@ namespace OpenSim.Server.Handlers.GridUser
|
||||
|
||||
rootElement.AppendChild(result);
|
||||
|
||||
return DocToBytes(doc);
|
||||
return Util.DocToBytes(doc);
|
||||
}
|
||||
|
||||
private byte[] FailureResult()
|
||||
@@ -301,20 +301,8 @@ namespace OpenSim.Server.Handlers.GridUser
|
||||
|
||||
rootElement.AppendChild(result);
|
||||
|
||||
return DocToBytes(doc);
|
||||
return Util.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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user