diff options
author | Justin Clark-Casey (justincc) | 2013-07-12 18:53:27 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-07-13 00:02:54 +0100 |
commit | 3d118fb580ea0a5e9d9b23f5f876fca80cd17d0e (patch) | |
tree | 27ab1b31ff1a739a6785b7f4411d980178b820ec /OpenSim/Region/ScriptEngine/Shared | |
parent | Enhance NullEstateData to remember stored estate values and return (diff) | |
download | opensim-SC_OLD-3d118fb580ea0a5e9d9b23f5f876fca80cd17d0e.zip opensim-SC_OLD-3d118fb580ea0a5e9d9b23f5f876fca80cd17d0e.tar.gz opensim-SC_OLD-3d118fb580ea0a5e9d9b23f5f876fca80cd17d0e.tar.bz2 opensim-SC_OLD-3d118fb580ea0a5e9d9b23f5f876fca80cd17d0e.tar.xz |
In co-op termination, extend EventWaitHandle to give this an indefinite lifetime in order to avoid a later RemotingException if scripts are being loaded into their own domains.
This is necessary because XEngineScriptBase now retains a reference to an EventWaitHandle when co-op termination is active.
Aims to address http://opensimulator.org/mantis/view.php?id=6634
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 887a317..229180f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -241,7 +241,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
241 | if (Engine.Config.GetString("ScriptStopStrategy", "abort") == "co-op") | 241 | if (Engine.Config.GetString("ScriptStopStrategy", "abort") == "co-op") |
242 | { | 242 | { |
243 | m_coopTermination = true; | 243 | m_coopTermination = true; |
244 | m_coopSleepHandle = new AutoResetEvent(false); | 244 | m_coopSleepHandle = new XEngineEventWaitHandle(false, EventResetMode.AutoReset); |
245 | } | 245 | } |
246 | } | 246 | } |
247 | 247 | ||
@@ -1201,4 +1201,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
1201 | Suspended = false; | 1201 | Suspended = false; |
1202 | } | 1202 | } |
1203 | } | 1203 | } |
1204 | } | 1204 | |
1205 | /// <summary> | ||
1206 | /// Xengine event wait handle. | ||
1207 | /// </summary> | ||
1208 | /// <remarks> | ||
1209 | /// This class exists becase XEngineScriptBase gets a reference to this wait handle. We need to make sure that | ||
1210 | /// when scripts are running in different AppDomains the lease does not expire. | ||
1211 | /// FIXME: Like LSL_Api, etc., this effectively leaks memory since the GC will never collect it. To avoid this, | ||
1212 | /// proper remoting sponsorship needs to be implemented across the board. | ||
1213 | /// </remarks> | ||
1214 | public class XEngineEventWaitHandle : EventWaitHandle | ||
1215 | { | ||
1216 | public XEngineEventWaitHandle(bool initialState, EventResetMode mode) : base(initialState, mode) {} | ||
1217 | |||
1218 | public override Object InitializeLifetimeService() | ||
1219 | { | ||
1220 | return null; | ||
1221 | } | ||
1222 | } | ||
1223 | } \ No newline at end of file | ||