lua-users home
lua-l archive

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

> One apparently missing feature in Lua's user-supplied allocator support 
> is a way for the allocator to be notified when it's already needed, so 
> it can free associated resources.

The standard way to free any host resources at Lua close time is to add
an entry in the registry. This entry sets a userdata with the appropiate
gc method, which will only be called when the registry is freed, ie, when
Lua closes. (If your application replaces the registry, you'll have to
recreate the entry there.)