mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
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! :)
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
|
||||
using System;
|
||||
using System.Runtime.Remoting.Lifetime;
|
||||
using System.Security.Permissions;
|
||||
using System.Threading;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
@@ -40,16 +41,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
{
|
||||
private Dictionary<string,MethodInfo> inits = new Dictionary<string,MethodInfo>();
|
||||
|
||||
//
|
||||
// Never expire this object
|
||||
//
|
||||
// Object expires if we don't keep it alive
|
||||
// sponsor will be added on object load
|
||||
[SecurityPermissionAttribute(SecurityAction.Demand,
|
||||
Flags = SecurityPermissionFlag.Infrastructure)]
|
||||
public override Object InitializeLifetimeService()
|
||||
{
|
||||
ILease lease = (ILease)base.InitializeLifetimeService();
|
||||
|
||||
if (lease.CurrentState == LeaseState.Initial)
|
||||
{
|
||||
lease.InitialLeaseTime = TimeSpan.Zero;
|
||||
lease.InitialLeaseTime = TimeSpan.FromMinutes(1);
|
||||
lease.SponsorshipTimeout = TimeSpan.FromMinutes(2);
|
||||
lease.RenewOnCallTime = TimeSpan.FromSeconds(2);
|
||||
}
|
||||
return lease;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user