diff options
author | Melanie | 2009-08-07 03:04:06 +0100 |
---|---|---|
committer | Melanie | 2009-08-07 03:04:06 +0100 |
commit | f8d8366bfa6f048107d22b4b73af22803810be81 (patch) | |
tree | 185a7ccc461a03366e1dade1a6f4ecf5d2c8f4f4 /OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | |
parent | Remove the forge module patch insertion area from prebuild.xml (diff) | |
download | opensim-SC-f8d8366bfa6f048107d22b4b73af22803810be81.zip opensim-SC-f8d8366bfa6f048107d22b4b73af22803810be81.tar.gz opensim-SC-f8d8366bfa6f048107d22b4b73af22803810be81.tar.bz2 opensim-SC-f8d8366bfa6f048107d22b4b73af22803810be81.tar.xz |
Revert the XEngine memleak patch, it causes premature GC.
This matches behavior seen with an earlier attempt to do this, apparently
the sponsor mechanism does't work in Mono
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs index d119a77..964fe4c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | |||
@@ -26,7 +26,6 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Runtime.Remoting; | ||
30 | using System.Runtime.Remoting.Lifetime; | 29 | using System.Runtime.Remoting.Lifetime; |
31 | using System.Security.Permissions; | 30 | using System.Security.Permissions; |
32 | using System.Threading; | 31 | using System.Threading; |
@@ -35,23 +34,26 @@ using System.Collections; | |||
35 | using System.Collections.Generic; | 34 | using System.Collections.Generic; |
36 | using OpenSim.Region.ScriptEngine.Interfaces; | 35 | using OpenSim.Region.ScriptEngine.Interfaces; |
37 | using OpenSim.Region.ScriptEngine.Shared; | 36 | using OpenSim.Region.ScriptEngine.Shared; |
38 | using OpenSim.Region.ScriptEngine.Shared.Api.Runtime; | ||
39 | 37 | ||
40 | namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | 38 | namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase |
41 | { | 39 | { |
42 | public partial class ScriptBaseClass : MarshalByRefObject, IScript | 40 | public partial class ScriptBaseClass : MarshalByRefObject, IScript |
43 | { | 41 | { |
44 | private Dictionary<string, MethodInfo> inits = new Dictionary<string, MethodInfo>(); | 42 | private Dictionary<string, MethodInfo> inits = new Dictionary<string, MethodInfo>(); |
45 | private ScriptSponsor m_sponser; | ||
46 | 43 | ||
44 | // Object expires if we don't keep it alive | ||
45 | // sponsor will be added on object load | ||
46 | [SecurityPermissionAttribute(SecurityAction.Demand, | ||
47 | Flags = SecurityPermissionFlag.Infrastructure)] | ||
47 | public override Object InitializeLifetimeService() | 48 | public override Object InitializeLifetimeService() |
48 | { | 49 | { |
49 | ILease lease = (ILease)base.InitializeLifetimeService(); | 50 | ILease lease = (ILease)base.InitializeLifetimeService(); |
50 | if (lease.CurrentState == LeaseState.Initial) | 51 | if (lease.CurrentState == LeaseState.Initial) |
51 | { | 52 | { |
52 | lease.InitialLeaseTime = TimeSpan.FromMinutes(1.0); | 53 | lease.InitialLeaseTime = TimeSpan.Zero; |
53 | lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); | 54 | // lease.InitialLeaseTime = TimeSpan.FromMinutes(1); |
54 | lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); | 55 | // lease.SponsorshipTimeout = TimeSpan.FromMinutes(2); |
56 | // lease.RenewOnCallTime = TimeSpan.FromSeconds(2); | ||
55 | } | 57 | } |
56 | return lease; | 58 | return lease; |
57 | } | 59 | } |
@@ -64,6 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
64 | } | 66 | } |
65 | #endif | 67 | #endif |
66 | 68 | ||
69 | |||
67 | public ScriptBaseClass() | 70 | public ScriptBaseClass() |
68 | { | 71 | { |
69 | m_Executor = new Executor(this); | 72 | m_Executor = new Executor(this); |
@@ -78,8 +81,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
78 | inits[type] = mi; | 81 | inits[type] = mi; |
79 | } | 82 | } |
80 | } | 83 | } |
81 | |||
82 | m_sponser = new ScriptSponsor(); | ||
83 | } | 84 | } |
84 | 85 | ||
85 | private Executor m_Executor = null; | 86 | private Executor m_Executor = null; |
@@ -111,9 +112,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
111 | if (!inits.ContainsKey(api)) | 112 | if (!inits.ContainsKey(api)) |
112 | return; | 113 | return; |
113 | 114 | ||
114 | ILease lease = (ILease)RemotingServices.GetLifetimeService(data as MarshalByRefObject); | ||
115 | lease.Register(m_sponser); | ||
116 | |||
117 | MethodInfo mi = inits[api]; | 115 | MethodInfo mi = inits[api]; |
118 | 116 | ||
119 | Object[] args = new Object[1]; | 117 | Object[] args = new Object[1]; |
@@ -124,11 +122,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
124 | m_InitialValues = GetVars(); | 122 | m_InitialValues = GetVars(); |
125 | } | 123 | } |
126 | 124 | ||
127 | public void Close() | ||
128 | { | ||
129 | m_sponser.Close(); | ||
130 | } | ||
131 | |||
132 | public Dictionary<string, object> GetVars() | 125 | public Dictionary<string, object> GetVars() |
133 | { | 126 | { |
134 | Dictionary<string, object> vars = new Dictionary<string, object>(); | 127 | Dictionary<string, object> vars = new Dictionary<string, object>(); |