mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
If the uuid of a SceneObjectGroup (RootPart) is changed before adding to the scene, remove the old uuid reference from m_parts as well as adding the new one.
The separate remove and set operations is SOG.set_UUID() are both locked under m_parts.SyncRoot since they are logically atomic (though this isn't such an issue if the SOG isn't part of a scene) Added unit test for this behaviour. Also changed the second m_parts.AddOrReplace() to m_parts.Add(). As the old reference is now removed we never end up replacing an identical uuid. And if we replace a uuid that's already there (from a child part) then this is an error.
This commit is contained in:
@@ -330,8 +330,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
get { return m_rootPart.UUID; }
|
||||
set
|
||||
{
|
||||
m_rootPart.UUID = value;
|
||||
m_parts.AddOrReplace(value, m_rootPart);
|
||||
lock (m_parts.SyncRoot)
|
||||
{
|
||||
m_parts.Remove(m_rootPart.UUID);
|
||||
m_rootPart.UUID = value;
|
||||
m_parts.Add(value, m_rootPart);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user