Yengine script, don't dispose twice

master
UbitUmarov 2020-02-26 05:17:46 +00:00
parent 20d77d3905
commit 7d7fc8f06a
1 changed files with 4 additions and 1 deletions

View File

@ -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()