From e41e52e09727842d990a31e2a5f7f3e9c88fe8b3 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Sun, 1 Jun 2014 17:39:11 +0300 Subject: Close streams immediately when we finish using them --- .../OfflineIM/Remote/OfflineIMServiceRobustConnector.cs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs') diff --git a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs index c44b6cc..b3673da 100644 --- a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs +++ b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs @@ -215,18 +215,7 @@ namespace OpenSim.OfflineIM 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); } #endregion -- cgit v1.1