diff options
author | UbitUmarov | 2018-07-14 14:05:47 +0100 |
---|---|---|
committer | UbitUmarov | 2018-07-14 14:05:47 +0100 |
commit | c7baee16380d67cecf7397258820eb50e2968eca (patch) | |
tree | 953049b7ec8bdaf4d6dcfc25dab84a655ca60759 /OpenSim/Capabilities/LLSDHelpers.cs | |
parent | missed one (diff) | |
download | opensim-SC-c7baee16380d67cecf7397258820eb50e2968eca.zip opensim-SC-c7baee16380d67cecf7397258820eb50e2968eca.tar.gz opensim-SC-c7baee16380d67cecf7397258820eb50e2968eca.tar.bz2 opensim-SC-c7baee16380d67cecf7397258820eb50e2968eca.tar.xz |
add using into a few more places
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Capabilities/LLSDHelpers.cs | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/OpenSim/Capabilities/LLSDHelpers.cs b/OpenSim/Capabilities/LLSDHelpers.cs index 4a7c6a5..e54618d 100644 --- a/OpenSim/Capabilities/LLSDHelpers.cs +++ b/OpenSim/Capabilities/LLSDHelpers.cs | |||
@@ -41,30 +41,32 @@ namespace OpenSim.Framework.Capabilities | |||
41 | 41 | ||
42 | public static string SerialiseLLSDReply(object obj) | 42 | public static string SerialiseLLSDReply(object obj) |
43 | { | 43 | { |
44 | StringWriter sw = new StringWriter(); | 44 | using(StringWriter sw = new StringWriter()) |
45 | XmlTextWriter writer = new XmlTextWriter(sw); | 45 | using(XmlTextWriter writer = new XmlTextWriter(sw)) |
46 | writer.Formatting = Formatting.None; | 46 | { |
47 | writer.WriteStartElement(String.Empty, "llsd", String.Empty); | 47 | writer.Formatting = Formatting.None; |
48 | SerializeOSDType(writer, obj); | 48 | writer.WriteStartElement(String.Empty, "llsd", String.Empty); |
49 | writer.WriteEndElement(); | 49 | SerializeOSDType(writer, obj); |
50 | writer.Close(); | 50 | writer.WriteEndElement(); |
51 | 51 | writer.Flush(); | |
52 | //m_log.DebugFormat("[LLSD Helpers]: Generated serialized LLSD reply {0}", sw.ToString()); | 52 | //m_log.DebugFormat("[LLSD Helpers]: Generated serialized LLSD reply {0}", sw.ToString()); |
53 | 53 | ||
54 | return sw.ToString(); | 54 | return sw.ToString(); |
55 | } | ||
55 | } | 56 | } |
56 | 57 | ||
57 | public static string SerialiseLLSDReplyNoHeader(object obj) | 58 | public static string SerialiseLLSDReplyNoHeader(object obj) |
58 | { | 59 | { |
59 | StringWriter sw = new StringWriter(); | 60 | using(StringWriter sw = new StringWriter()) |
60 | XmlTextWriter writer = new XmlTextWriter(sw); | 61 | using(XmlTextWriter writer = new XmlTextWriter(sw)) |
61 | writer.Formatting = Formatting.None; | 62 | { |
62 | SerializeOSDType(writer, obj); | 63 | writer.Formatting = Formatting.None; |
63 | writer.Close(); | 64 | SerializeOSDType(writer, obj); |
64 | 65 | writer.Flush(); | |
65 | //m_log.DebugFormat("[LLSD Helpers]: Generated serialized LLSD reply {0}", sw.ToString()); | 66 | //m_log.DebugFormat("[LLSD Helpers]: Generated serialized LLSD reply {0}", sw.ToString()); |
66 | 67 | ||
67 | return sw.ToString(); | 68 | return sw.ToString(); |
69 | } | ||
68 | } | 70 | } |
69 | 71 | ||
70 | private static void SerializeOSDType(XmlTextWriter writer, object obj) | 72 | private static void SerializeOSDType(XmlTextWriter writer, object obj) |