fix (maybe) the bad GC bug in luainterface?
This commit is contained in:
parent
133d92cb6e
commit
759a4536a4
|
@ -618,6 +618,18 @@ namespace Lua511
|
||||||
static void lua_atunlock(IntPtr luaState, LuaCSFunction^ unlockf);
|
static void lua_atunlock(IntPtr luaState, LuaCSFunction^ unlockf);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//zero 22-jul-2017
|
||||||
|
static int lua_pushthread(IntPtr luaState)
|
||||||
|
{
|
||||||
|
return ::lua_pushthread(((lua_State *)luaState.ToPointer()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void lua_xmove(IntPtr from, IntPtr to, int n)
|
||||||
|
{
|
||||||
|
::lua_xmove(((lua_State *)from.ToPointer()), ((lua_State *)to.ToPointer()),n);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void lua_pushnumber(IntPtr luaState, double number)
|
static void lua_pushnumber(IntPtr luaState, double number)
|
||||||
{
|
{
|
||||||
::lua_pushnumber(toState, number);
|
::lua_pushnumber(toState, number);
|
||||||
|
|
|
@ -68,7 +68,7 @@ namespace NLua
|
||||||
"-- Preload the mscorlib assembly \n"+
|
"-- Preload the mscorlib assembly \n"+
|
||||||
"luanet.load_assembly(\"mscorlib\") \n";
|
"luanet.load_assembly(\"mscorlib\") \n";
|
||||||
|
|
||||||
/*readonly */ IntPtr luaState;
|
/*readonly */ public IntPtr luaState; //zero 22-jul-2017 - made public
|
||||||
ObjectTranslator translator;
|
ObjectTranslator translator;
|
||||||
|
|
||||||
LuaCSFunction panicCallback, lockCallback, unlockCallback;
|
LuaCSFunction panicCallback, lockCallback, unlockCallback;
|
||||||
|
|
|
@ -803,6 +803,13 @@ namespace NLua
|
||||||
{
|
{
|
||||||
((LuaFunction)o).push(luaState);
|
((LuaFunction)o).push(luaState);
|
||||||
}
|
}
|
||||||
|
//zero 22-jul-2017
|
||||||
|
else if (o is Lua)
|
||||||
|
{
|
||||||
|
var lua = o as Lua;
|
||||||
|
LuaDLL.lua_pushnil(lua.luaState);
|
||||||
|
LuaDLL.lua_xmove(lua.luaState, luaState, 1);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pushObject(luaState,o,"luaNet_metatable");
|
pushObject(luaState,o,"luaNet_metatable");
|
||||||
|
|
Loading…
Reference in New Issue