collectgarbage("collect")
> <no finalizer called>
So the problem
is that once my finalizer is called it's never called again, but I still have
references to the object. Is that normal ? Since after the finalizer call I have
access to my object in the global scope, what prevents me from calling methods
on it ? In fact I've tested it with a slightly more complex object, and methods
get passed an invalid object. Methods that will misbehave if I don't detect
myself if the object I'm getting has already been finalized or
not.
I don't mind
getting an answer like "storing references to an object in its finalizer is
forbidden", provided it's official (like explicitly stated in the manual). But
even in that cases it sounds a bit scary (fortunately it's not possible
to reproduce the case with pure lua).
Jérôme.