lua-users home
lua-l archive

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



On Aug 16, 2009, at 2:54 PM, Michael Newberry wrote:

No, I returned both lightuserdata and the metatable containing the GC method.

You did not return (full) userdata. You returned lightuserdata. We are all telling you, over and over again, this won't work.

I also tried returning the pointer to the userdata using lua_pushlightuserdata and that made no difference.

lua_pushlightuserdata does not return (full) userdata.

lua_newuserdata pushes the (full) userdata on the Lua stack. That is what you need to return from your function.

Remember I am returning two values, and I am assigning the second value to a table element back in the lua code. The two return values are stored in a table which I has setup as a class.

That doesn't help since neither is the (full) userdata you need to store.

e