diff options
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/Framework/Scenes/Scene.cs
OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 1d3ba6c..ee5f519 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -244,12 +244,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
244 | get { return m_ConfigSource; } | 244 | get { return m_ConfigSource; } |
245 | } | 245 | } |
246 | 246 | ||
247 | /// <summary> | ||
248 | /// Event fired after the script engine has finished removing a script. | ||
249 | /// </summary> | ||
247 | public event ScriptRemoved OnScriptRemoved; | 250 | public event ScriptRemoved OnScriptRemoved; |
251 | |||
252 | /// <summary> | ||
253 | /// Event fired after the script engine has finished removing a script from an object. | ||
254 | /// </summary> | ||
248 | public event ObjectRemoved OnObjectRemoved; | 255 | public event ObjectRemoved OnObjectRemoved; |
249 | 256 | ||
250 | // | ||
251 | // IRegionModule functions | ||
252 | // | ||
253 | public void Initialise(IConfigSource configSource) | 257 | public void Initialise(IConfigSource configSource) |
254 | { | 258 | { |
255 | if (configSource.Configs["XEngine"] == null) | 259 | if (configSource.Configs["XEngine"] == null) |
@@ -1199,7 +1203,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1199 | m_Scripts.Remove(itemID); | 1203 | m_Scripts.Remove(itemID); |
1200 | lockScriptsForWrite(false); | 1204 | lockScriptsForWrite(false); |
1201 | instance.ClearQueue(); | 1205 | instance.ClearQueue(); |
1202 | instance.Stop(0); | 1206 | |
1207 | // Give the script some time to finish processing its last event. Simply aborting the script thread can | ||
1208 | // cause issues on mono 2.6, 2.10 and possibly later where locks are not released properly on abort. | ||
1209 | instance.Stop(1000); | ||
1203 | 1210 | ||
1204 | // bool objectRemoved = false; | 1211 | // bool objectRemoved = false; |
1205 | 1212 | ||
@@ -1231,8 +1238,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1231 | UnloadAppDomain(instance.AppDomain); | 1238 | UnloadAppDomain(instance.AppDomain); |
1232 | } | 1239 | } |
1233 | 1240 | ||
1234 | instance = null; | ||
1235 | |||
1236 | ObjectRemoved handlerObjectRemoved = OnObjectRemoved; | 1241 | ObjectRemoved handlerObjectRemoved = OnObjectRemoved; |
1237 | if (handlerObjectRemoved != null) | 1242 | if (handlerObjectRemoved != null) |
1238 | { | 1243 | { |