diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index e8f7011..e864090 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -96,7 +96,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
96 | public class SceneObjectPart : IScriptHost, ISerializable | 96 | public class SceneObjectPart : IScriptHost, ISerializable |
97 | { | 97 | { |
98 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 98 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
99 | 99 | ||
100 | // use only one serializer to give the runtime a chance to optimize it (it won't do that if you | ||
101 | // use a new instance every time) | ||
102 | private static XmlSerializer serializer = new XmlSerializer(typeof (SceneObjectPart)); | ||
103 | |||
100 | #region Fields | 104 | #region Fields |
101 | 105 | ||
102 | [XmlIgnore] | 106 | [XmlIgnore] |
@@ -1619,7 +1623,6 @@ if (m_shape != null) { | |||
1619 | /// <returns></returns> | 1623 | /// <returns></returns> |
1620 | public static SceneObjectPart FromXml(UUID fromUserInventoryItemId, XmlReader xmlReader) | 1624 | public static SceneObjectPart FromXml(UUID fromUserInventoryItemId, XmlReader xmlReader) |
1621 | { | 1625 | { |
1622 | XmlSerializer serializer = new XmlSerializer(typeof (SceneObjectPart)); | ||
1623 | SceneObjectPart part = (SceneObjectPart)serializer.Deserialize(xmlReader); | 1626 | SceneObjectPart part = (SceneObjectPart)serializer.Deserialize(xmlReader); |
1624 | part.m_fromUserInventoryItemID = fromUserInventoryItemId; | 1627 | part.m_fromUserInventoryItemID = fromUserInventoryItemId; |
1625 | 1628 | ||
@@ -3186,7 +3189,6 @@ if (m_shape != null) { | |||
3186 | /// <param name="xmlWriter"></param> | 3189 | /// <param name="xmlWriter"></param> |
3187 | public void ToXml(XmlWriter xmlWriter) | 3190 | public void ToXml(XmlWriter xmlWriter) |
3188 | { | 3191 | { |
3189 | XmlSerializer serializer = new XmlSerializer(typeof (SceneObjectPart)); | ||
3190 | serializer.Serialize(xmlWriter, this); | 3192 | serializer.Serialize(xmlWriter, this); |
3191 | } | 3193 | } |
3192 | 3194 | ||