Hi All,
I am using luajava in my project, but I met a problem when calling a javafunction from a coroutine. The parameter passed to that function in lua could not be found in the stack.
My question is: Is there any fix for this issue? I checked the luajava release history, no version mentions the related fix.
Thanks
In case you don't want to click the link above, here is a small test code:
In Java:
JavaFunction test = new JavaFunction(L) {
@Override
public int execute() throws LuaException {
System.out.println("Size: " + L.getTop());
return 0;
}
};
test.register("testJavaFunction");
In Lua:
testJavaFunction('param1', 'param2')
output: Size: 3
-- with coroutine
local co = coroutine.create(function()
testJavaFunction('param1', 'param2')
end)
coroutine.resume(co)
output: Size: 1
Best regards,
Bo