diff options
author | Tedd Hansen | 2007-08-25 15:31:47 +0000 |
---|---|---|
committer | Tedd Hansen | 2007-08-25 15:31:47 +0000 |
commit | 53be4774b32f6736373c1364c3bd659c977fbb4e (patch) | |
tree | c81bbc0d41b375bcc403c574da612d18b038c228 /OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL | |
parent | Hopefully fixed the bugs in primitives rotation editing (diff) | |
download | opensim-SC-53be4774b32f6736373c1364c3bd659c977fbb4e.zip opensim-SC-53be4774b32f6736373c1364c3bd659c977fbb4e.tar.gz opensim-SC-53be4774b32f6736373c1364c3bd659c977fbb4e.tar.bz2 opensim-SC-53be4774b32f6736373c1364c3bd659c977fbb4e.tar.xz |
Scripts no longer crash sim after 5 minutes (override InitializeLifetimeService). Loading/Unloading of scripts are now handled in separate thread so server is no delayed because of this. Each script is loaded into a single AppDomain (temporary test for script unload, eats ~15KB more memory for each script). Unload of scripts has been verified to free up memory.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs index bfb8913..cb0f9ba 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL_BaseClass.cs | |||
@@ -5,14 +5,33 @@ using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler; | |||
5 | using OpenSim.Region.ScriptEngine.Common; | 5 | using OpenSim.Region.ScriptEngine.Common; |
6 | using System.Threading; | 6 | using System.Threading; |
7 | using System.Reflection; | 7 | using System.Reflection; |
8 | 8 | using System.Runtime.Remoting.Lifetime; | |
9 | 9 | ||
10 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | 10 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL |
11 | { | 11 | { |
12 | public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript | 12 | public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript |
13 | { | 13 | { |
14 | |||
15 | // Object never expires | ||
16 | public override Object InitializeLifetimeService() | ||
17 | { | ||
18 | Console.WriteLine("LSL_BaseClass: InitializeLifetimeService()"); | ||
19 | // return null; | ||
20 | ILease lease = (ILease)base.InitializeLifetimeService(); | ||
21 | |||
22 | if (lease.CurrentState == LeaseState.Initial) | ||
23 | { | ||
24 | lease.InitialLeaseTime = TimeSpan.Zero; // TimeSpan.FromMinutes(1); | ||
25 | //lease.SponsorshipTimeout = TimeSpan.FromMinutes(2); | ||
26 | //lease.RenewOnCallTime = TimeSpan.FromSeconds(2); | ||
27 | } | ||
28 | return lease; | ||
29 | } | ||
30 | |||
31 | |||
14 | private Executor m_Exec; | 32 | private Executor m_Exec; |
15 | public Executor Exec { | 33 | public Executor Exec |
34 | { | ||
16 | get | 35 | get |
17 | { | 36 | { |
18 | if (m_Exec == null) | 37 | if (m_Exec == null) |