|
Hi Luiz, On 19/04/13 09:07, Luiz Henrique de Figueiredo wrote:
There doesn't seem to be a "__gc" call though- would I be correct in assuming that it isn't there as MT doesn't really need specific cleanup during garbage collection?Yes. Anyone using MT must provide a struct to it. lrandom uses lua_newuserdata to allocate one; this memory is fully managed by Lua. OTOH, lgdbm uses handles provided by gdbm and so must register a gc method for closing the databases when the handle is collected in Lua.
Excellent, thanks for the clarification. I'll also check out lgdbm for a gc example- thankyou again for the useful information.
Cheers, Garth