lua-users home
lua-l archive

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


Hello everybody.

I'm trying (unsuccessfully) to see in the docs if a function argument
can be collected during a pcall. What I mean is:

0.- I push a function.
1.- I push a userdata object as argument.
2.- I do lua_pcall(L,1,1,0) ( Or lua_call or other similar stuff ).

Can my object be garbage collected before returning from pcall (i.e.,
if the function sets its argument to nil and then calls collectgarbage
).?

I need to know this because the object I push has a __gc method which
destroys it, and I need to access some data inside it just after
return.

( I know I can keep it alive by storing it in the registry or dupping
it or anything similar ).

Francisco Olarte.