aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs17
1 files changed, 13 insertions, 4 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 45db5f7..1603c52 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -311,8 +311,19 @@ namespace OpenSim.Region.Environment.Scenes
311 311
312 public string ToXmlString() 312 public string ToXmlString()
313 { 313 {
314 StringWriter sw = new StringWriter(); 314 using (StringWriter sw = new StringWriter())
315 XmlTextWriter writer = new XmlTextWriter(sw); 315 {
316 using (XmlTextWriter writer = new XmlTextWriter(sw))
317 {
318 ToXml(writer);
319 }
320
321 return sw.ToString();
322 }
323 }
324
325 public void ToXml(XmlTextWriter writer)
326 {
316 writer.WriteStartElement(String.Empty, "SceneObjectGroup", String.Empty); 327 writer.WriteStartElement(String.Empty, "SceneObjectGroup", String.Empty);
317 writer.WriteStartElement(String.Empty, "RootPart", String.Empty); 328 writer.WriteStartElement(String.Empty, "RootPart", String.Empty);
318 m_rootPart.ToXml(writer); 329 m_rootPart.ToXml(writer);
@@ -329,8 +340,6 @@ namespace OpenSim.Region.Environment.Scenes
329 } 340 }
330 writer.WriteEndElement(); 341 writer.WriteEndElement();
331 writer.WriteEndElement(); 342 writer.WriteEndElement();
332 writer.Close();
333 return sw.ToString();
334 } 343 }
335 344
336 #region Copying 345 #region Copying