From 491d898db8303c829d1e43f5c63afa05d6f6a445 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 9 Jun 2010 03:51:43 +0100 Subject: If a script is deleted before it gets compiled, don't even bother to try compiling it --- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 98e77c0..f702e65 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -122,6 +122,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine private ScriptCompileQueue m_CompileQueue = new ScriptCompileQueue(); IWorkItemResult m_CurrentCompile = null; + private Dictionary m_CompileDict = new Dictionary(); public string ScriptEngineName { @@ -492,6 +493,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine else { m_CompileQueue.Enqueue(parms); + lock (m_CompileDict) + { + m_CompileDict[itemID] = 0; + } if (m_CurrentCompile == null) { @@ -554,6 +559,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine bool postOnRez = (bool)p[4]; StateSource stateSource = (StateSource)p[5]; + lock(m_CompileDict) + { + if (!m_CompileDict.ContainsKey(itemID)) + return false; + m_CompileDict.Remove(itemID); + } + // Get the asset ID of the script, so we can check if we // already have it. @@ -794,6 +806,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine public void OnRemoveScript(uint localID, UUID itemID) { + // If it's not yet been compiled, make sure we don't try + lock (m_CompileDict) + { + if (m_CompileDict.ContainsKey(itemID)) + m_CompileDict.Remove(itemID); + } + lock (m_Scripts) { // Do we even have it? -- cgit v1.1