aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneManager.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneManager.cs31
1 files changed, 5 insertions, 26 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs
index f1b09ca..89e3ac5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs
@@ -92,7 +92,11 @@ namespace OpenSim.Region.Framework.Scenes
92 private static SceneManager m_instance = null; 92 private static SceneManager m_instance = null;
93 public static SceneManager Instance 93 public static SceneManager Instance
94 { 94 {
95 get { return m_instance; } 95 get {
96 if (m_instance == null)
97 m_instance = new SceneManager();
98 return m_instance;
99 }
96 } 100 }
97 101
98 private readonly DoubleDictionary<UUID, string, Scene> m_localScenes = new DoubleDictionary<UUID, string, Scene>(); 102 private readonly DoubleDictionary<UUID, string, Scene> m_localScenes = new DoubleDictionary<UUID, string, Scene>();
@@ -134,31 +138,6 @@ namespace OpenSim.Region.Framework.Scenes
134 138
135 public void Close() 139 public void Close()
136 { 140 {
137 // collect known shared modules in sharedModules
138 Dictionary<string, IRegionModule> sharedModules = new Dictionary<string, IRegionModule>();
139
140 List<Scene> sceneList = Scenes;
141 for (int i = 0; i < sceneList.Count; i++)
142 {
143 // extract known shared modules from scene
144 foreach (string k in sceneList[i].Modules.Keys)
145 {
146 if (sceneList[i].Modules[k].IsSharedModule &&
147 !sharedModules.ContainsKey(k))
148 sharedModules[k] = sceneList[i].Modules[k];
149 }
150 // close scene/region
151 sceneList[i].Close();
152 }
153
154 // all regions/scenes are now closed, we can now safely
155 // close all shared modules
156 foreach (IRegionModule mod in sharedModules.Values)
157 {
158 mod.Close();
159 }
160
161 m_localScenes.Clear();
162 } 141 }
163 142
164 public void Close(Scene cscene) 143 public void Close(Scene cscene)