diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs index 36e1f497af..f6ccf01bc0 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClientCollection.cs @@ -247,16 +247,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP ////return success; - //lock (m_sync) - // return Dictionary2.TryGetValue(key, out value); - - try - { + lock (m_sync) return Dictionary2.TryGetValue(key, out value); - } - catch { } - value = null; - return false; + + //try + //{ + // return Dictionary2.TryGetValue(key, out value); + //} + //catch { } + //value = null; + //return false; } @@ -268,8 +268,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP //try { Parallel.ForEach(Array, action); } //finally { if (doLock) rwLock.ExitUpgradeableReadLock(); } + LLUDPClient[] localArray = null; lock (m_sync) - Parallel.ForEach(Array, action); + { + localArray = new LLUDPClient[Array.Length]; + Array.CopyTo(localArray, 0); + } + + Parallel.ForEach(localArray, action); } }