lua-users home
lua-l archive

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


Let's assume that we have some userdata objects with a __gc metamethod which are
still alive at the end of the execution of a "main" Lua script. 

1. Is it guaranteed that the still alive objects will be garbage collected and
the __gc metamethod invoked on them (barring "mutual referencing" situations
where such objects cannot be collected) ?

2. Is it fine to invoke assert or error from the code inside __gc?

An example could be the file handle from the io library.

Thanks!