From 1eeffcd89e5ef30ccfe7bbefc98d362ebfae6a89 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Thu, 27 Nov 2008 13:41:26 +0000 Subject: Test commit.. just contains div trace and other stuff. --- .../ScriptEngine/Shared/Api/Runtime/Executor.cs | 7 ++----- .../ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | 24 +++++++++++++++------- .../Shared/Api/Runtime/ScriptSponsor.cs | 8 ++++++++ 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs index 63ae6c7..d76c7c1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs @@ -205,13 +205,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase // if ( !(tie.InnerException is EventAbortException) ) { - throw tie; + throw; } } - catch (Exception e) - { - throw e; - } + } protected void initEventFlags() diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs index 06307bb..15604dc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs @@ -39,7 +39,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { public partial class ScriptBaseClass : MarshalByRefObject, IScript { - private Dictionary inits = new Dictionary(); + private Dictionary inits = new Dictionary(); // Object expires if we don't keep it alive // sponsor will be added on object load @@ -50,25 +50,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase 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; } +#if DEBUG + // For tracing GC while debugging + public static bool GCDummy = false; + ~ScriptBaseClass() + { + GCDummy = true; + } +#endif + public ScriptBaseClass() { m_Executor = new Executor(this); - MethodInfo[] myArrayMethodInfo = GetType().GetMethods(BindingFlags.Public|BindingFlags.Instance); + MethodInfo[] myArrayMethodInfo = GetType().GetMethods(BindingFlags.Public | BindingFlags.Instance); foreach (MethodInfo mi in myArrayMethodInfo) { if (mi.Name.Length > 7 && mi.Name.Substring(0, 7) == "ApiType") { - string type=mi.Name.Substring(7); - inits[type]=mi; + string type = mi.Name.Substring(7); + inits[type] = mi; } } } @@ -130,7 +140,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase foreach (FieldInfo field in fields) { - m_Fields[field.Name]=field; + m_Fields[field.Name] = field; if (field.FieldType == typeof(LSL_Types.list)) // ref type, copy { @@ -141,7 +151,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase c.Data = data; vars[field.Name] = c; } - else if (field.FieldType == typeof(LSL_Types.LSLInteger) || + else if (field.FieldType == typeof(LSL_Types.LSLInteger) || field.FieldType == typeof(LSL_Types.LSLString) || field.FieldType == typeof(LSL_Types.LSLFloat) || field.FieldType == typeof(Int32) || @@ -174,7 +184,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase Array.Copy(data, 0, v.Data, 0, data.Length); m_Fields[var.Key].SetValue(this, v); } - else if (m_Fields[var.Key].FieldType == typeof(LSL_Types.LSLInteger) || + else if (m_Fields[var.Key].FieldType == typeof(LSL_Types.LSLInteger) || m_Fields[var.Key].FieldType == typeof(LSL_Types.LSLString) || m_Fields[var.Key].FieldType == typeof(LSL_Types.LSLFloat) || m_Fields[var.Key].FieldType == typeof(Int32) || diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptSponsor.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptSponsor.cs index 5b28608..13c25d7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptSponsor.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptSponsor.cs @@ -14,5 +14,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Runtime { return TimeSpan.FromMinutes(2); } +#if DEBUG + // For tracing GC while debugging + public static bool GCDummy = false; + ~ScriptSponsor() + { + GCDummy = true; + } +#endif } } -- cgit v1.1