From ad0d2fea20217bebaeb1b1ebbae85be56d17a21d Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 7 Aug 2009 21:30:21 +0100 Subject: Experimental! Implement ISponsor in ScriptInstance --- .../ScriptEngine/Shared/Instance/ScriptInstance.cs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 7b6b49f..4211ced 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -53,7 +53,7 @@ using OpenSim.Region.ScriptEngine.Interfaces; namespace OpenSim.Region.ScriptEngine.Shared.Instance { - public class ScriptInstance : IScriptInstance + public class ScriptInstance : MarshalByRefObject, IScriptInstance, ISponsor { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -96,7 +96,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance private string m_CurrentState = String.Empty; private UUID m_RegionID = UUID.Zero; - private ScriptSponsor m_ScriptSponsor; private Dictionary, KeyValuePair> m_LineMap; @@ -261,9 +260,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance Path.GetFileNameWithoutExtension(assembly), "SecondLife.Script"); - m_ScriptSponsor = new ScriptSponsor(); ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass); - lease.Register(m_ScriptSponsor); + lease.Register(this); } catch (Exception) { @@ -365,14 +363,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance } } - ~ScriptInstance() - { - m_Script.Close(); - m_ScriptSponsor.Close(); - ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass); - lease.Unregister(m_ScriptSponsor); - } - public void Init() { if (!m_startOnInit) return; @@ -1016,5 +1006,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance { return true; } + + public TimeSpan Renewal(ILease lease) + { + return lease.InitialLeaseTime; + } } } -- cgit v1.1