aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs23
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 8da06d1..3646c98 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -242,7 +242,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
242 if (Engine.Config.GetString("ScriptStopStrategy", "abort") == "co-op") 242 if (Engine.Config.GetString("ScriptStopStrategy", "abort") == "co-op")
243 { 243 {
244 m_coopTermination = true; 244 m_coopTermination = true;
245 m_coopSleepHandle = new AutoResetEvent(false); 245 m_coopSleepHandle = new XEngineEventWaitHandle(false, EventResetMode.AutoReset);
246 } 246 }
247 } 247 }
248 248
@@ -1221,4 +1221,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
1221 Suspended = false; 1221 Suspended = false;
1222 } 1222 }
1223 } 1223 }
1224} 1224
1225 /// <summary>
1226 /// Xengine event wait handle.
1227 /// </summary>
1228 /// <remarks>
1229 /// This class exists becase XEngineScriptBase gets a reference to this wait handle. We need to make sure that
1230 /// when scripts are running in different AppDomains the lease does not expire.
1231 /// FIXME: Like LSL_Api, etc., this effectively leaks memory since the GC will never collect it. To avoid this,
1232 /// proper remoting sponsorship needs to be implemented across the board.
1233 /// </remarks>
1234 public class XEngineEventWaitHandle : EventWaitHandle
1235 {
1236 public XEngineEventWaitHandle(bool initialState, EventResetMode mode) : base(initialState, mode) {}
1237
1238 public override Object InitializeLifetimeService()
1239 {
1240 return null;
1241 }
1242 }
1243} \ No newline at end of file