publicLuaFunctionRegisterFunction(stringpath,objecttarget,MethodBasefunction/*MethodInfo function*/)//CP: Fix for struct constructor by Alexander Kappner (link: http://luaforge.net/forum/forum.php?thread_id = 2859&forum_id = 145)
publicLuaFunctionRegisterFunction(stringpath,objecttarget,MethodBasefunction/*MethodInfo function*/)//CP: Fix for struct constructor by Alexander Kappner (link: http://luaforge.net/forum/forum.php?thread_id = 2859&forum_id = 145)
Debug.WriteLine(string.Format("An error occurred during an attempt to retrieve an extractor ({0}) while checking for params array status.",paramElementType.FullName));
Debug.WriteLine(string.Format("An error occurred during an attempt to retrieve an extractor ({0}) while checking for params array status.",paramElementType.FullName));
// Note: starting with lua5.1 the garbage collector may remove weak reference items (such as our luaNet_objects values) when the initial GC sweep
// Note: starting with lua5.1 the garbage collector may remove weak reference items (such as our luaNet_objects values) when the initial GC sweep
// occurs, but the actual call of the __gc finalizer for that object may not happen until a little while later. During that window we might call
// occurs, but the actual call of the __gc finalizer for that object may not happen until a little while later. During that window we might call
// this routine and find the element missing from luaNet_objects, but collectObject() has not yet been called. In that case, we go ahead and call collect
// this routine and find the element missing from luaNet_objects, but collectObject() has not yet been called. In that case, we go ahead and call collect
// object here
// object here
// did we find a non nil object in our table? if not, we need to call collect object
// did we find a non nil object in our table? if not, we need to call collect object
vartype=LuaLib.lua_type(luaState,-1);
vartype=LuaLib.LuaType(luaState,-1);
if(type!=LuaTypes.Nil){
if(type!=LuaTypes.Nil){
LuaLib.lua_remove(luaState,-2);// drop the metatable - we're going to leave our object on the stack
LuaLib.LuaRemove(luaState,-2);// drop the metatable - we're going to leave our object on the stack
return;
return;
}
}
// MetaFunctions.dumpStack(this, luaState);
// MetaFunctions.dumpStack(this, luaState);
LuaLib.lua_remove(luaState,-1);// remove the nil object value
LuaLib.LuaRemove(luaState,-1);// remove the nil object value
LuaLib.lua_remove(luaState,-1);// remove the metatable
LuaLib.LuaRemove(luaState,-1);// remove the metatable
collectObject(o,index);// Remove from both our tables and fall out to get a new ID
CollectObject(o,index);// Remove from both our tables and fall out to get a new ID
}
}
index=addObject(o);
index=AddObject(o);
pushNewObject(luaState,o,index,metatable);
PushNewObject(luaState,o,index,metatable);
}
}
/*
/*
* Pushes a new object into the Lua stack with the provided
* Pushes a new object into the Lua stack with the provided