Skip to main content

close

Function close 

Source
pub fn close(state: LuaState)
Expand description

Close the Lua state and free all resources.

PORT NOTE: In C, lua_close gets the main thread via G(L)->mainthread and closes that regardless of which thread is passed. In Rust, the caller should hold the main LuaState and drop it (which triggers close_state via this function or Drop).


//   lua_lock(L);
//   L = G(L)->mainthread;  /* only the main thread can be closed */
//   close_state(L);
// }