BOLTStack.LuaBaseFunctor.OnDisposeUnmangedResources C# (CSharp) Method

OnDisposeUnmangedResources() protected method

protected OnDisposeUnmangedResources ( ) : void
return void
        protected override void OnDisposeUnmangedResources()
        {
            base.OnDisposeUnmangedResources();
            Application.Invoke(() =>
            {
                if (_luaState == IntPtr.Zero) return;
                const int luaRegistryIndex = (int)LuaInnerIndex.LUA_REGISTRYINDEX;
                Lua.luaL_unref(_luaState, luaRegistryIndex, _luaFunctionRefIndex);
                _luaState = IntPtr.Zero;
                _luaFunctionRefIndex = 0;
            });
        }