|
Philippe, Gé,
I 'like' how you reduce my __close-related question to __gc ones. Unfortunately you're missing the point. __close is not a finalizer. Why you keep insisting I shouldn't rely on the precise timing of calling __close is beyond my understanding. The thing is, I want it (obviously) to run on a non-garbage-collected object. Just like any regular code.
There's a very simple use case documented right in the 5.4 manual for an object that might have no references to it visible from Lua (and possibly from any C function Lua may call), yet it has to live to see its its metamethod __close called at the right time. Look at the generic for loop.
The answer to my question cannot be 'no', that's the point:).
Best regards,
--
DoubleF