lua-users home
lua-l archive

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


> On manual finalization (something like fh:close()) I reset the metatable
> of that userdata to nil ("I'm done with it - never wanna see it again.").

That would not be a problem. What would be a problem is the reverse,
to put a metatable (with a __gc) into a userdata that did not have a
metatable (or that had a metatable without a __gc).

(Moreover, Mike Pall's suggestion (of turning to the current behavior if
the search gets too long) seems a nice compromise to avoid worst-case
behavior even in that situation.)

-- Roberto