From f27f8610726b1e148d17e69c7fef34d2fc814bd3 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 2 Apr 2008 16:46:58 +0000 Subject: * Attempt to resolve mantis 873 by placing caps removal operations in a critical section --- OpenSim/Region/Environment/Scenes/Scene.cs | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 7ee0478..2237922 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1755,20 +1755,23 @@ namespace OpenSim.Region.Environment.Scenes /// public void RemoveCapsHandler(LLUUID agentId) { - if (m_capsHandlers.ContainsKey(agentId)) + lock (m_capsHandlers) { - m_log.DebugFormat( - "[CAPS]: Removing CAPS handler for root agent {0} in {1}", - agentId, RegionInfo.RegionName); - - m_capsHandlers[agentId].DeregisterHandlers(); - m_capsHandlers.Remove(agentId); - } - else - { - m_log.WarnFormat( - "[CAPS]: Received request to remove CAPS handler for root agent {0} in {1}, but no such CAPS handler found!", - agentId, RegionInfo.RegionName); + if (m_capsHandlers.ContainsKey(agentId)) + { + m_log.DebugFormat( + "[CAPS]: Removing CAPS handler for root agent {0} in {1}", + agentId, RegionInfo.RegionName); + + m_capsHandlers[agentId].DeregisterHandlers(); + m_capsHandlers.Remove(agentId); + } + else + { + m_log.WarnFormat( + "[CAPS]: Received request to remove CAPS handler for root agent {0} in {1}, but no such CAPS handler found!", + agentId, RegionInfo.RegionName); + } } } -- cgit v1.1