Avoid race condition between m_PrimObjects iteration in XEngine.PostObjectEvent and places where the list is modified by extending the m_PrimObjects lock.

0.7.4.1
Justin Clark-Casey (justincc) 2012-06-22 02:23:25 +01:00
parent 9f3feeff8d
commit 80a41e670d
1 changed files with 14 additions and 14 deletions

View File

@ -1363,22 +1363,22 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return false;
uuids = m_PrimObjects[localID];
}
foreach (UUID itemID in uuids)
{
IScriptInstance instance = null;
try
foreach (UUID itemID in uuids)
{
if (m_Scripts.ContainsKey(itemID))
instance = m_Scripts[itemID];
}
catch { /* ignore race conditions */ }
IScriptInstance instance = null;
try
{
if (m_Scripts.ContainsKey(itemID))
instance = m_Scripts[itemID];
}
catch { /* ignore race conditions */ }
if (instance != null)
{
instance.PostEvent(p);
result = true;
if (instance != null)
{
instance.PostEvent(p);
result = true;
}
}
}