lua-users home
lua-l archive

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

I always use a separate table for the metatable (and set __metatable to 'false') so the user can't do something like:
object:__gc(), you don't want the object finalized before it's unreachable.

Explicit finalization should be done using the __close metamethod in Lua 5.4.x, and your userdata object must be robust against abuse of the facility.