aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-01-14 00:23:11 +0000
committerJustin Clark-Casey (justincc)2012-01-14 00:23:11 +0000
commitb5bb559cc020df0b2e7d77a46f7d47a8fed1bc9f (patch)
treec4516b37b09c2a104019845ef167c262836487e9 /OpenSim/Region/ScriptEngine/Shared
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-b5bb559cc020df0b2e7d77a46f7d47a8fed1bc9f.zip
opensim-SC_OLD-b5bb559cc020df0b2e7d77a46f7d47a8fed1bc9f.tar.gz
opensim-SC_OLD-b5bb559cc020df0b2e7d77a46f7d47a8fed1bc9f.tar.bz2
opensim-SC_OLD-b5bb559cc020df0b2e7d77a46f7d47a8fed1bc9f.tar.xz
Register the UrlModule for script engine events OnScriptRemoved and OnObjectRemoved just once in the UrlModule itself, rather than repeatedly for every script.
Doing this in every script is unnecessary since the event trigger is parameterized by the item id. All that would happen is 2000 scripts would trigger 1999 unnecessary calls, and a large number of initialized scripts may eventually trigger a StackOverflowException. Registration moved to UrlModule so that the handler is registered for all script engine implementations. This required moving the OnScriptRemoved and OnObjectRemoved events (only used by UrlModule in core) from IScriptEngine to IScriptModule to avoid circular references.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs5
1 files changed, 0 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index ab175ba..fb930e0 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -126,11 +126,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
126 m_TransferModule = 126 m_TransferModule =
127 m_ScriptEngine.World.RequestModuleInterface<IMessageTransferModule>(); 127 m_ScriptEngine.World.RequestModuleInterface<IMessageTransferModule>();
128 m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); 128 m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();
129 if (m_UrlModule != null)
130 {
131 m_ScriptEngine.OnScriptRemoved += m_UrlModule.ScriptRemoved;
132 m_ScriptEngine.OnObjectRemoved += m_UrlModule.ObjectRemoved;
133 }
134 129
135 AsyncCommands = new AsyncCommandManager(ScriptEngine); 130 AsyncCommands = new AsyncCommandManager(ScriptEngine);
136 } 131 }