aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs30
1 files changed, 15 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
index b1f4b84..090f1d5 100644
--- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs
@@ -381,25 +381,25 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
381 381
382 if (m_curlisteners < m_maxlisteners) 382 if (m_curlisteners < m_maxlisteners)
383 { 383 {
384 int newHandle = GetNewHandle(itemID); 384 lock (m_listeners)
385
386 if (newHandle > 0)
387 { 385 {
388 ListenerInfo li = new ListenerInfo(newHandle, localID, itemID, hostID, channel, name, id, msg); 386 int newHandle = GetNewHandle(itemID);
389 387
390 lock (m_listeners) 388 if (newHandle > 0)
391 { 389 {
392 List<ListenerInfo> listeners; 390 ListenerInfo li = new ListenerInfo(newHandle, localID, itemID, hostID, channel, name, id, msg);
393 if (!m_listeners.TryGetValue(channel,out listeners))
394 {
395 listeners = new List<ListenerInfo>();
396 m_listeners.Add(channel, listeners);
397 }
398 listeners.Add(li);
399 m_curlisteners++;
400 }
401 391
402 return newHandle; 392 List<ListenerInfo> listeners;
393 if (!m_listeners.TryGetValue(channel,out listeners))
394 {
395 listeners = new List<ListenerInfo>();
396 m_listeners.Add(channel, listeners);
397 }
398 listeners.Add(li);
399 m_curlisteners++;
400
401 return newHandle;
402 }
403 } 403 }
404 } 404 }
405 return -1; 405 return -1;