Closed niess closed 3 years ago
okay, that's fixed now, but generally don't do this; you have no way to :free()
the callback afterwards, so you leak resources, and with luajit it's especially bad considering the callback limits
you should always cast the lua function first, then save the result, pass it where you want it, and explicitly :free()
the callback once you're done with it
Thanks!
I missed this point indeed. Usually my application uses only a few callbacks. Yet it could be problematic indeed. I will change this and make sure to :free()
.
Hello,
thank you for this great work :)
I am trying to adapt an existing
LuaJIT+ffi
project such that it could run withLua
as well using thecffi
package. Doing so I am stuck with the following use case. When assigning aLua
callback to aC
struct I get a segfault. Yet it works withLuaJIT
. Below is a minimal example:The last line gives a segfault on Debian using
Lua 5.4
+cffi
. What could be the reason?