Another stab at cmickeyb's patch for script GC.

Moved the Close() for the appdomain-hosted parts into a new destructor
on ScriptInstance.
This commit is contained in:
Melanie
2009-08-07 20:43:23 +01:00
parent 2148f84e1e
commit 4ee8d8a813
11 changed files with 69 additions and 68 deletions

View File

@@ -32,15 +32,19 @@ using System.Text;
namespace OpenSim.Region.ScriptEngine.Shared.Api.Runtime
{
[Serializable]
public class ScriptSponsor : MarshalByRefObject, ISponsor
{
// In theory: I execute, therefore I am.
// If GC collects this class then sponsorship will expire
private bool m_closed = false;
public TimeSpan Renewal(ILease lease)
{
return TimeSpan.FromMinutes(2);
if (!m_closed)
return lease.InitialLeaseTime;
return TimeSpan.FromTicks(0);
}
public void Close() { m_closed = true; }
#if DEBUG
// For tracing GC while debugging
public static bool GCDummy = false;