From b6b83be56266e3d6f863af9158fa2248dba2261f Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Wed, 11 Mar 2009 09:07:50 +0000 Subject: [PATCH] From: Alan M Webb This fixes *another* sync error in a list/dictionary iterator. This time in WorldComm. I'm beginning to think something is going on... --- .../Scripting/WorldComm/WorldCommModule.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 090f1d54d8..08e08c8ebe 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs @@ -575,13 +575,16 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm { List data = new List(); - foreach (List list in m_listeners.Values) + lock (m_listeners) { - foreach (ListenerInfo l in list) - { - if (l.GetItemID() == itemID) - data.AddRange(l.GetSerializationData()); - } + foreach (List list in m_listeners.Values) + { + foreach (ListenerInfo l in list) + { + if (l.GetItemID() == itemID) + data.AddRange(l.GetSerializationData()); + } + } } return (Object[])data.ToArray(); }