lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Sat, 31 Jan 2009 11:49:41 +0100
Anders Backman <> wrote:

> To load an external module, require 'modulename' is used. This means
> that luaopen_modulename is located in the dll-file.
> Now is there no loaclose_modulename() wich can be called from lua?
> luaclose/luaunload,...?
> If luaopen_module setup tables registrates calls etc, then one also
> want to clear this dynamically, right? or?
there's no official way to 'unload' module. but you can assign nil to
_G['modname'] и packages.loaded['modname']. if there's no other
references, Lua will GC module table. so you can set your own GC
handler and do necessary cleanup.