aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine
diff options
context:
space:
mode:
authorTedd Hansen2008-11-26 11:12:57 +0000
committerTedd Hansen2008-11-26 11:12:57 +0000
commite6ddb5de7de4ed61fa19b3805cd77104328eb20a (patch)
tree37c975b8d660174d96c05830daf7aab92eaf2309 /OpenSim/Region/ScriptEngine/DotNetEngine
parentComment one more field that can't be tested that way anymore (diff)
downloadopensim-SC-e6ddb5de7de4ed61fa19b3805cd77104328eb20a.zip
opensim-SC-e6ddb5de7de4ed61fa19b3805cd77104328eb20a.tar.gz
opensim-SC-e6ddb5de7de4ed61fa19b3805cd77104328eb20a.tar.bz2
opensim-SC-e6ddb5de7de4ed61fa19b3805cd77104328eb20a.tar.xz
Attempt to give script objects a proper lease time (DNE and xengine). Relies on GC. Also removed lease for LSL_Api as it strictly speaking should not be MarshalByRef. Or should it? If so I broke scripting! :)
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index bd60759..b5cbd25 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -28,6 +28,8 @@
28using System; 28using System;
29using System.Reflection; 29using System.Reflection;
30using System.Globalization; 30using System.Globalization;
31using System.Runtime.Remoting;
32using System.Runtime.Remoting.Lifetime;
31using log4net; 33using log4net;
32using OpenMetaverse; 34using OpenMetaverse;
33using OpenSim.Framework; 35using OpenSim.Framework;
@@ -39,6 +41,7 @@ using System.Collections.Generic;
39using System.IO; 41using System.IO;
40using System.Runtime.Serialization.Formatters.Binary; 42using System.Runtime.Serialization.Formatters.Binary;
41using System.Threading; 43using System.Threading;
44using OpenSim.Region.ScriptEngine.Shared.Api.Runtime;
42using OpenSim.Region.ScriptEngine.Shared.ScriptBase; 45using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
43using OpenSim.Region.ScriptEngine.Shared.CodeTools; 46using OpenSim.Region.ScriptEngine.Shared.CodeTools;
44 47
@@ -56,6 +59,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
56 public Dictionary<string, IScriptApi> Apis; 59 public Dictionary<string, IScriptApi> Apis;
57 public Dictionary<KeyValuePair<int,int>, KeyValuePair<int,int>> 60 public Dictionary<KeyValuePair<int,int>, KeyValuePair<int,int>>
58 LineMap; 61 LineMap;
62 public ISponsor ScriptSponsor;
59 } 63 }
60 64
61 public class ScriptManager 65 public class ScriptManager
@@ -164,6 +168,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
164 CompiledScript = 168 CompiledScript =
165 m_scriptEngine.m_AppDomainManager.LoadScript( 169 m_scriptEngine.m_AppDomainManager.LoadScript(
166 CompiledScriptFile, out id.AppDomain); 170 CompiledScriptFile, out id.AppDomain);
171 //Register the sponsor
172 ISponsor scriptSponsor = new ScriptSponsor();
173 ILease lease = (ILease)RemotingServices.GetLifetimeService(CompiledScript as MarshalByRefObject);
174 lease.Register(scriptSponsor);
175 id.ScriptSponsor = scriptSponsor;
167 176
168 id.LineMap = LSLCompiler.LineMap(); 177 id.LineMap = LSLCompiler.LineMap();
169 id.Script = CompiledScript; 178 id.Script = CompiledScript;