mirror of
https://github.com/opensim/opensim.git
synced 2026-06-30 02:57:02 +08:00
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.
This commit is contained in:
@@ -42,10 +42,6 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
|
||||
/// An interface for a script API module to communicate with
|
||||
/// the engine it's running under
|
||||
/// </summary>
|
||||
|
||||
public delegate void ScriptRemoved(UUID script);
|
||||
public delegate void ObjectRemoved(UUID prim);
|
||||
|
||||
public interface IScriptEngine
|
||||
{
|
||||
/// <summary>
|
||||
@@ -57,9 +53,6 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
|
||||
|
||||
IScriptModule ScriptModule { get; }
|
||||
|
||||
event ScriptRemoved OnScriptRemoved;
|
||||
event ObjectRemoved OnObjectRemoved;
|
||||
|
||||
/// <summary>
|
||||
/// Post an event to a single script
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user