Inconsistent locking of SenseRepeaters in Script Engine.
When I attempt to 'save oar' on a region with thousands of scripts with timers, I get a NullReferenceException every time. The problem comes from inconsistent locking in SensorRepeat.cs of the SenseRepeaters List. It is iterated and modified in many places and these places are all wrapped in a lock except in the GetSerializationData(). This is the function throwing the exception because an item in the list becomes null during iteration. The attached patch locks SenseRepeatListLock in GetSerializationData()0.6.8-post-fixes
parent
b0923e0d73
commit
71c929137f
|
@ -516,16 +516,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||||
{
|
{
|
||||||
List<Object> data = new List<Object>();
|
List<Object> data = new List<Object>();
|
||||||
|
|
||||||
foreach (SenseRepeatClass ts in SenseRepeaters)
|
lock (SenseRepeatListLock)
|
||||||
{
|
{
|
||||||
if (ts.itemID == itemID)
|
foreach (SenseRepeatClass ts in SenseRepeaters)
|
||||||
{
|
{
|
||||||
data.Add(ts.interval);
|
if (ts.itemID == itemID)
|
||||||
data.Add(ts.name);
|
{
|
||||||
data.Add(ts.keyID);
|
data.Add(ts.interval);
|
||||||
data.Add(ts.type);
|
data.Add(ts.name);
|
||||||
data.Add(ts.range);
|
data.Add(ts.keyID);
|
||||||
data.Add(ts.arc);
|
data.Add(ts.type);
|
||||||
|
data.Add(ts.range);
|
||||||
|
data.Add(ts.arc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return data.ToArray();
|
return data.ToArray();
|
||||||
|
|
Loading…
Reference in New Issue