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/Instance | |
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/Instance')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 6d62249..8168300 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -96,8 +96,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
96 | private string m_CurrentState = String.Empty; | 96 | private string m_CurrentState = String.Empty; |
97 | private UUID m_RegionID = UUID.Zero; | 97 | private UUID m_RegionID = UUID.Zero; |
98 | 98 | ||
99 | private ScriptSponsor m_ScriptSponsor; | 99 | //private ISponsor m_ScriptSponsor; |
100 | private bool m_destroyed = false; | ||
101 | private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> | 100 | private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> |
102 | m_LineMap; | 101 | m_LineMap; |
103 | 102 | ||
@@ -262,9 +261,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
262 | Path.GetFileNameWithoutExtension(assembly), | 261 | Path.GetFileNameWithoutExtension(assembly), |
263 | "SecondLife.Script"); | 262 | "SecondLife.Script"); |
264 | 263 | ||
265 | m_ScriptSponsor = new ScriptSponsor(); | 264 | // Add a sponsor to the script |
266 | ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass); | 265 | // ISponsor scriptSponsor = new ScriptSponsor(); |
267 | lease.Register(m_ScriptSponsor); | 266 | // ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as MarshalByRefObject); |
267 | // lease.Register(scriptSponsor); | ||
268 | //m_ScriptSponsor = scriptSponsor; | ||
269 | |||
268 | } | 270 | } |
269 | catch (Exception) | 271 | catch (Exception) |
270 | { | 272 | { |
@@ -447,13 +449,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
447 | { | 449 | { |
448 | ReleaseControls(); | 450 | ReleaseControls(); |
449 | AsyncCommandManager.RemoveScript(m_Engine, m_LocalID, m_ItemID); | 451 | AsyncCommandManager.RemoveScript(m_Engine, m_LocalID, m_ItemID); |
450 | |||
451 | m_Script.Close(); | ||
452 | m_ScriptSponsor.Close(); | ||
453 | ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass); | ||
454 | lease.Unregister(m_ScriptSponsor); | ||
455 | |||
456 | m_destroyed = true; | ||
457 | } | 452 | } |
458 | 453 | ||
459 | public void RemoveState() | 454 | public void RemoveState() |
@@ -889,8 +884,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
889 | 884 | ||
890 | public void SaveState(string assembly) | 885 | public void SaveState(string assembly) |
891 | { | 886 | { |
892 | |||
893 | |||
894 | // If we're currently in an event, just tell it to save upon return | 887 | // If we're currently in an event, just tell it to save upon return |
895 | // | 888 | // |
896 | if (m_InEvent) | 889 | if (m_InEvent) |
@@ -899,10 +892,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
899 | return; | 892 | return; |
900 | } | 893 | } |
901 | 894 | ||
902 | // Data may not be available as the script has already been destroyed | ||
903 | if (m_destroyed == true) | ||
904 | return; | ||
905 | |||
906 | PluginData = AsyncCommandManager.GetSerializationData(m_Engine, m_ItemID); | 895 | PluginData = AsyncCommandManager.GetSerializationData(m_Engine, m_ItemID); |
907 | 896 | ||
908 | string xml = ScriptSerializer.Serialize(this); | 897 | string xml = ScriptSerializer.Serialize(this); |