Skip to main content

close

Function close 

Source
pub fn close(state: LuaState)
Expand description

Close the Lua state and free all resources.

In C, lua_close gets the main thread via G(L)->mainthread and closes that regardless of which thread is passed. Here, callers must pass the main LuaState directly; this does not traverse to the main thread — the caller owns the root state — and does not assert that state is indeed the main thread before closing it.