[LLDB/Lua] call lua_close() on Lua dtor
authorPedro Tammela <pctammela@gmail.com>
Sun, 1 Nov 2020 18:02:30 +0000 (18:02 +0000)
committerPedro Tammela <pctammela@gmail.com>
Mon, 2 Nov 2020 16:52:30 +0000 (16:52 +0000)
commit4d7d6f276c6df9e0a4cc3d9fccfaf84face62311
tree6c4c795ca51ce421e1282906b8d81938cda4066f
parenta1aaa9ef783a82fd3df0de00a5f4edf19b2234a8
[LLDB/Lua] call lua_close() on Lua dtor

This patch calls `lua_close()` on Lua dtor.

This guarantees that the Lua GC finalizers are honored, aside from the
usual internal clean up.

It also guarantees a call to the `__close` metamethod of any active
to-be-closed variable in Lua 5.4.

Since the previous `luaL_openlibs()` was a noop, because the standard
library is cached internally, I've removed it.

Differential Revision: https://reviews.llvm.org/D90557
lldb/source/Plugins/ScriptInterpreter/Lua/Lua.h