lua-users home
lua-l archive

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


On Thu, Sep 2, 2010 at 12:14 PM, Sylvain Fabre
<sylvain.fabre@inpixal.com> wrote:
>  This is an option too, but in that case, i need to know wich objects are
> marked as 'free' from the LUA engine. An right now, i do not know if there
> is a way to achieve this.

Have you looked into the __gc metamethod that you can use on full
userdata? It's called when the Lua GC is collecting that userdatum,
and it's good for releasing attached memory in C, decrementing
refcounts, closing file descriptors, and so on.

~Jonathan