Skip to contents

Clears out all variables from the default Lua state, freeing up the associated memory.

Usage

lua_reset()

Value

None.

Details

This resets the default Lua state only. To reset a non-default Lua state L returned by lua_open(), just do L <- lua_open() again. The memory previously used will be cleaned up at the next garbage collection.

Examples

lua("a = 2")
lua_reset()
lua("print(a)") # nil