Skip to content

fix: lua_state now returns a LuaThread

Alexey Protsenko requested to merge fix/lua-new-thread into master

Lua now has a type parameter OnDrop, which determines what happens when this instance is dropped. There are now 3 variants of Lua:

  • type TempLua = Lua<on_drop::Close>; lua_close will be called in drop
  • type StaticLua = Lua<on_drop::Ignore>; nothing happens in drop
  • type LuaThread = Lua<on_drop::Unref>; luaL_unref is called in drop

LuaThread can only be created from a StaticLua, so we don't to think about what happens when the parent state is closed

Merge request reports