* Adding some locks to XEngine's m_PrimObjects which were prone to 'the collection was modified'
parent
027ae58dc4
commit
ca0de93d9a
|
@ -572,12 +572,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
m_Scripts[itemID] = instance;
|
||||
}
|
||||
|
||||
lock (m_PrimObjects)
|
||||
{
|
||||
if (!m_PrimObjects.ContainsKey(localID))
|
||||
m_PrimObjects[localID] = new List<UUID>();
|
||||
|
||||
if (!m_PrimObjects[localID].Contains(itemID))
|
||||
m_PrimObjects[localID].Add(itemID);
|
||||
|
||||
}
|
||||
|
||||
if (!m_Assemblies.ContainsKey(assetID))
|
||||
m_Assemblies[assetID] = assembly;
|
||||
}
|
||||
|
@ -604,6 +608,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
if (part != null)
|
||||
part.RemoveScriptEvents(itemID);
|
||||
|
||||
lock (m_PrimObjects)
|
||||
{
|
||||
// Remove the script from it's prim
|
||||
if (m_PrimObjects.ContainsKey(localID))
|
||||
{
|
||||
|
@ -617,6 +623,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
m_PrimObjects.Remove(localID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
|
||||
if (m_DomainScripts[instance.AppDomain].Count == 0)
|
||||
|
@ -750,9 +757,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
{
|
||||
bool result = false;
|
||||
|
||||
lock (m_PrimObjects)
|
||||
{
|
||||
if (!m_PrimObjects.ContainsKey(localID))
|
||||
return false;
|
||||
|
||||
|
||||
foreach (UUID itemID in m_PrimObjects[localID])
|
||||
{
|
||||
if (m_Scripts.ContainsKey(itemID))
|
||||
|
@ -765,6 +775,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue