while investigating why IRCBridgeModule.Close() was having no effect, i

noticed that Scene.Close() will only call Close on non-shared region
modules. i've now added code to SceneManager.Close() to collect all
shared region module from each scene before calling Scene.Close()
on it and then, once, all Scenes are closed, go through the list of
collected shared region modules and close them as well. SceneManager.Close()
is only called when we initiate a shutdown --- i've verified that a
Scene restart does not trigger the shutdown of shared modules :-)

also, this adds a couple of bug fixes to the IRCBridgeModule (which
after all didn't take kindly to being closed) as well as a check to
InterregionModule's Close() call.

finally, this fixes the RestPlugin's XmlWriter so that it no longer
includes the "xsd=..." and "xsi=..." junk.
This commit is contained in:
Dr Scofield
2008-05-30 12:29:30 +00:00
parent 1a47ff8094
commit 9590e671e6
6 changed files with 65 additions and 18 deletions

View File

@@ -32,6 +32,7 @@ using System.Reflection;
using libsecondlife;
using log4net;
using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces;
namespace OpenSim.Region.Environment.Scenes
{
@@ -78,10 +79,27 @@ namespace OpenSim.Region.Environment.Scenes
public void Close()
{
// collect known shared modules in sharedModules
Dictionary<string, IRegionModule> sharedModules = new Dictionary<string, IRegionModule>();
for (int i = 0; i < m_localScenes.Count; i++)
{
// extract known shared modules from scene
foreach(string k in m_localScenes[i].Modules.Keys)
{
if (m_localScenes[i].Modules[k].IsSharedModule &&
!sharedModules.ContainsKey(k))
sharedModules[k] = m_localScenes[i].Modules[k];
}
// close scene/region
m_localScenes[i].Close();
}
// all regions/scenes are now closed, we can now safely
// close all shared modules
foreach(IRegionModule mod in sharedModules.Values)
{
mod.Close();
}
}
public void Close(Scene cscene)