I'm using a custom shared library from lua. To load this library I have the required by Lua function luaopen_mylib
. However this library needs to free resources and other thing when its being unloaded; so I'm wondering, does Lua calls some function when closing a shared library (luaclose_*
or similar).
If not, any suggestions of how to do that?, note that the lua code isn't actually aware that it is being closed before I call lua_close(luaState)
, only the host program knows about it.
The shared library is multithreaded, if that needs special handling.