lua-users home
lua-l archive

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

On Tue, Nov 24, 2015 at 3:27 PM, Patrick Donnelly <>
> Sorry, one more message to respond to the "breaks a major assumption": are you talking about the issue of calling __gc more than once on a object?

The major assumption is that once the finalizer is called (and it does not resurrect the object), the object is never accessible by any user code, and so no library routine, including "close" and __gc, will ever be called with that object.

That assumption is not 100% correct because a dedicated user (given a lenient library) could still obtain __gc and call it. I doubt this is widely understood by everybody who writes code callable from Lua, but the implications are not severe because this will not happen in normal use. Same for handling multiple "close" calls: they won't happen in normal use.