예제 #1
0
        /// <summary>
        /// Called for each lua_lock call
        /// </summary>
        /// <param name = "luaState"></param>
        /// Not yet used

        /*int LockCallback(LuaCore.lua_State luaState)
         * {
         *      // Monitor.Enter(luaLock);
         *      return 0;
         * }*/

        /// <summary>
        /// Called for each lua_unlock call
        /// </summary>
        /// <param name = "luaState"></param>
        /// Not yet used

        /*int UnlockCallback(LuaCore.lua_State luaState)
         * {
         *      // Monitor.Exit(luaLock);
         *      return 0;
         * }*/

        public void Close()
        {
            if (_StatePassed)
            {
                return;
            }

            //////   if(luaState != LuaCore.lua_State.Zero)
            if (!luaState.IsNull())
            {
                LuaCore.lua_close(luaState);
            }
            //luaState = LuaCore.lua_State.Zero; <- suggested by Christopher Cebulski http://luaforge.net/forum/forum.php?thread_id = 44593&forum_id = 146
        }
예제 #2
0
        public void Close()
        {
            if (_StatePassed)
            {
                return;
            }

            if (!luaState.IsNull())
            {
                LuaCore.lua_close(luaState);
                ObjectTranslatorPool.Instance.Remove(luaState);
            }
            //luaState = LuaCore.lua_State.Zero; <- suggested by Christopher Cebulski http://luaforge.net/forum/forum.php?thread_id = 44593&forum_id = 146
        }
예제 #3
0
파일: Lua.cs 프로젝트: cdhowie/NLua
        public void Close()
        {
            if (_StatePassed)
            {
                return;
            }

            if (!luaState.IsNull())
            {
                LuaCore.lua_close(luaState);
                ObjectTranslatorPool.Instance.Remove(luaState);
            }

            luaState = new LuaCore.lua_State();             // <- suggested by Christopher Cebulski http://luaforge.net/forum/forum.php?thread_id = 44593&forum_id = 146

            lock (releasedReferences) {
                releasedReferences.Clear();
            }
        }