From 7d7fc8f06a9c52946f205a6b4fbd507ab1260c52 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 26 Feb 2020 05:17:46 +0000 Subject: [PATCH] Yengine script, don't dispose twice --- OpenSim/Region/ScriptEngine/YEngine/XMRInstMisc.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMRInstMisc.cs b/OpenSim/Region/ScriptEngine/YEngine/XMRInstMisc.cs index 5b96b00c8c..bfe93618b4 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMRInstMisc.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMRInstMisc.cs @@ -61,11 +61,13 @@ namespace OpenSim.Region.ScriptEngine.Yengine public partial class XMRInstance { + private bool m_disposed; // In case Dispose() doesn't get called, we want to be sure to clean // up. This makes sure we decrement m_CompiledScriptRefCount. ~XMRInstance() { - Dispose(); + if(!m_disposed) + Dispose(); } /** @@ -90,6 +92,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine // Let script methods get garbage collected if no one else is using // them. DecObjCodeRefCount(); + m_disposed = true; } private void DecObjCodeRefCount()