lua-users home
lua-l archive

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


I wrote:

 Note that the udata created by lua_newuserdata has no references inside Lua
 at birth, and so you have to set it to a global variable or a table field,
 or something; otherwise it will be collected next time.

but I've misread the code: lua_newuserdata leaves the udata on the top of the
stack, so it won't be collected while you are in the C function that called
lua_newuserdata.
--lhf