diff options
author | Justin Clark-Casey (justincc) | 2014-07-02 23:48:44 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-07-02 23:49:25 +0100 |
commit | 889194db63016ad4b9ecb0c6ae82d3d9c7632c95 (patch) | |
tree | 823eba42a9ce5fcb04b8c7e1ff6e50deedc726f6 /OpenSim/Region/Application | |
parent | minor: Change default max phys prim size in code to match OpenSimDefaults.ini (diff) | |
download | opensim-SC-889194db63016ad4b9ecb0c6ae82d3d9c7632c95.zip opensim-SC-889194db63016ad4b9ecb0c6ae82d3d9c7632c95.tar.gz opensim-SC-889194db63016ad4b9ecb0c6ae82d3d9c7632c95.tar.bz2 opensim-SC-889194db63016ad4b9ecb0c6ae82d3d9c7632c95.tar.xz |
Actually call Close() for shared region modules when the simulator is being shutdown.
Adds regression test for this case.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 4c1914a..d2dce24 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -71,6 +71,20 @@ namespace OpenSim | |||
71 | // OpenSim.ini Section name for ESTATES Settings | 71 | // OpenSim.ini Section name for ESTATES Settings |
72 | public const string ESTATE_SECTION_NAME = "Estates"; | 72 | public const string ESTATE_SECTION_NAME = "Estates"; |
73 | 73 | ||
74 | /// <summary> | ||
75 | /// Allow all plugin loading to be disabled for tests/debug. | ||
76 | /// </summary> | ||
77 | /// <remarks> | ||
78 | /// true by default | ||
79 | /// </remarks> | ||
80 | public bool EnableInitialPluginLoad { get; set; } | ||
81 | |||
82 | /// <summary> | ||
83 | /// Control whether we attempt to load an estate data service. | ||
84 | /// </summary> | ||
85 | /// <remarks>For tests/debugging</remarks> | ||
86 | public bool LoadEstateDataService { get; set; } | ||
87 | |||
74 | protected string proxyUrl; | 88 | protected string proxyUrl; |
75 | protected int proxyOffset = 0; | 89 | protected int proxyOffset = 0; |
76 | 90 | ||
@@ -96,7 +110,7 @@ namespace OpenSim | |||
96 | 110 | ||
97 | public ConsoleCommand CreateAccount = null; | 111 | public ConsoleCommand CreateAccount = null; |
98 | 112 | ||
99 | protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); | 113 | public List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>(); |
100 | 114 | ||
101 | /// <value> | 115 | /// <value> |
102 | /// The config information passed into the OpenSimulator region server. | 116 | /// The config information passed into the OpenSimulator region server. |
@@ -135,6 +149,8 @@ namespace OpenSim | |||
135 | /// <param name="configSource"></param> | 149 | /// <param name="configSource"></param> |
136 | public OpenSimBase(IConfigSource configSource) : base() | 150 | public OpenSimBase(IConfigSource configSource) : base() |
137 | { | 151 | { |
152 | EnableInitialPluginLoad = true; | ||
153 | LoadEstateDataService = true; | ||
138 | LoadConfigSettings(configSource); | 154 | LoadConfigSettings(configSource); |
139 | } | 155 | } |
140 | 156 | ||
@@ -236,20 +252,25 @@ namespace OpenSim | |||
236 | if (String.IsNullOrEmpty(module)) | 252 | if (String.IsNullOrEmpty(module)) |
237 | throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] or [EstateService] section"); | 253 | throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] or [EstateService] section"); |
238 | 254 | ||
239 | m_estateDataService = ServerUtils.LoadPlugin<IEstateDataService>(module, new object[] { Config }); | 255 | if (LoadEstateDataService) |
240 | if (m_estateDataService == null) | 256 | { |
241 | throw new Exception( | 257 | m_estateDataService = ServerUtils.LoadPlugin<IEstateDataService>(module, new object[] { Config }); |
242 | string.Format( | 258 | if (m_estateDataService == null) |
243 | "Could not load an IEstateDataService implementation from {0}, as configured in the LocalServiceModule parameter of the [EstateDataStore] config section.", | 259 | throw new Exception( |
244 | module)); | 260 | string.Format( |
261 | "Could not load an IEstateDataService implementation from {0}, as configured in the LocalServiceModule parameter of the [EstateDataStore] config section.", | ||
262 | module)); | ||
263 | } | ||
245 | 264 | ||
246 | base.StartupSpecific(); | 265 | base.StartupSpecific(); |
247 | 266 | ||
248 | LoadPlugins(); | 267 | if (EnableInitialPluginLoad) |
268 | LoadPlugins(); | ||
269 | |||
270 | // We still want to post initalize any plugins even if loading has been disabled since a test may have | ||
271 | // inserted them manually. | ||
249 | foreach (IApplicationPlugin plugin in m_plugins) | 272 | foreach (IApplicationPlugin plugin in m_plugins) |
250 | { | ||
251 | plugin.PostInitialise(); | 273 | plugin.PostInitialise(); |
252 | } | ||
253 | 274 | ||
254 | if (m_console != null) | 275 | if (m_console != null) |
255 | AddPluginCommands(m_console); | 276 | AddPluginCommands(m_console); |
@@ -874,6 +895,9 @@ namespace OpenSim | |||
874 | try | 895 | try |
875 | { | 896 | { |
876 | SceneManager.Close(); | 897 | SceneManager.Close(); |
898 | |||
899 | foreach (IApplicationPlugin plugin in m_plugins) | ||
900 | plugin.Dispose(); | ||
877 | } | 901 | } |
878 | catch (Exception e) | 902 | catch (Exception e) |
879 | { | 903 | { |