diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptSponsor.cs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptSponsor.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptSponsor.cs index a2da14e..977ac30 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptSponsor.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptSponsor.cs | |||
@@ -32,15 +32,19 @@ using System.Text; | |||
32 | 32 | ||
33 | namespace OpenSim.Region.ScriptEngine.Shared.Api.Runtime | 33 | namespace OpenSim.Region.ScriptEngine.Shared.Api.Runtime |
34 | { | 34 | { |
35 | [Serializable] | ||
36 | public class ScriptSponsor : MarshalByRefObject, ISponsor | 35 | public class ScriptSponsor : MarshalByRefObject, ISponsor |
37 | { | 36 | { |
38 | // In theory: I execute, therefore I am. | 37 | private bool m_closed = false; |
39 | // If GC collects this class then sponsorship will expire | 38 | |
40 | public TimeSpan Renewal(ILease lease) | 39 | public TimeSpan Renewal(ILease lease) |
41 | { | 40 | { |
42 | return TimeSpan.FromMinutes(2); | 41 | if (!m_closed) |
42 | return lease.InitialLeaseTime; | ||
43 | return TimeSpan.FromTicks(0); | ||
43 | } | 44 | } |
45 | |||
46 | public void Close() { m_closed = true; } | ||
47 | |||
44 | #if DEBUG | 48 | #if DEBUG |
45 | // For tracing GC while debugging | 49 | // For tracing GC while debugging |
46 | public static bool GCDummy = false; | 50 | public static bool GCDummy = false; |