From 543d1fe70b54fb26d7ce19b397468c66269f0e20 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 8 May 2013 21:14:52 +0100 Subject: Guard the scene list when estates are updated --- .../Region/CoreModules/World/Estate/XEstateConnector.cs | 17 ++++++++++------- .../Region/CoreModules/World/Estate/XEstateModule.cs | 6 ++++-- 2 files changed, 14 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Estate/XEstateConnector.cs b/OpenSim/Region/CoreModules/World/Estate/XEstateConnector.cs index 948c893..73e706c 100644 --- a/OpenSim/Region/CoreModules/World/Estate/XEstateConnector.cs +++ b/OpenSim/Region/CoreModules/World/Estate/XEstateConnector.cs @@ -136,15 +136,18 @@ namespace OpenSim.Region.CoreModules.World.Estate // Handle local regions locally // - foreach (Scene s in m_EstateModule.Scenes) + lock (m_EstateModule.Scenes) { - if (regions.Contains(s.RegionInfo.RegionID)) + foreach (Scene s in m_EstateModule.Scenes) { - // All regions in one estate are in the same scope. - // Use that scope. - // - ScopeID = s.RegionInfo.ScopeID; - regions.Remove(s.RegionInfo.RegionID); + if (regions.Contains(s.RegionInfo.RegionID)) + { + // All regions in one estate are in the same scope. + // Use that scope. + // + ScopeID = s.RegionInfo.ScopeID; + regions.Remove(s.RegionInfo.RegionID); + } } } diff --git a/OpenSim/Region/CoreModules/World/Estate/XEstateModule.cs b/OpenSim/Region/CoreModules/World/Estate/XEstateModule.cs index 1f099c6..f54ab2c 100644 --- a/OpenSim/Region/CoreModules/World/Estate/XEstateModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/XEstateModule.cs @@ -93,7 +93,8 @@ namespace OpenSim.Region.CoreModules.World.Estate public void AddRegion(Scene scene) { - m_Scenes.Add(scene); + lock (m_Scenes) + m_Scenes.Add(scene); scene.EventManager.OnNewClient += OnNewClient; } @@ -111,7 +112,8 @@ namespace OpenSim.Region.CoreModules.World.Estate { scene.EventManager.OnNewClient -= OnNewClient; - m_Scenes.Remove(scene); + lock (m_Scenes) + m_Scenes.Remove(scene); } public string Name -- cgit v1.1