From 5229a3c51ce8f87c7833b3ae49a6f65ddb377ce9 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Thu, 10 Jul 2014 16:00:06 +0300 Subject: [PATCH] Added locking in AccessModule to prevent possible errors when shutting down a simulator that has >1 region --- .../Region/CoreModules/World/Access/AccessModule.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs index 1599f1537f..f567cab8bf 100644 --- a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs +++ b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs @@ -91,13 +91,17 @@ namespace OpenSim.Region.CoreModules.World public void AddRegion(Scene scene) { - if (!m_SceneList.Contains(scene)) - m_SceneList.Add(scene); + lock (m_SceneList) + { + if (!m_SceneList.Contains(scene)) + m_SceneList.Add(scene); + } } public void RemoveRegion(Scene scene) { - m_SceneList.Remove(scene); + lock (m_SceneList) + m_SceneList.Remove(scene); } public void RegionLoaded(Scene scene)