[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Program end and __gc
- From: KR <krunal.rao78@...>
- Date: Mon, 31 Oct 2011 16:22:59 +0000 (UTC)
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.