Martin Nilsson (Coppermist) @ Pike (-) developers forum wrote:
Why do we delay object destruction btw?
It appears that that is not the case anymore.
If I recall correctly, mast once explained to me that destructors of objects on the stack are called some time after a function has ended. I think I actually checked that, and that must have been in Pike 7.8.
The testprogram I just listed in the previous mail, seems to indicate that all objects are now destructed as soon as the scope closes. I.e. the delayed destruct is not happening any longer, regardless of the IMMEDIATE_DESTRUCT flag. It seems to work reliably for any nested block; which is great, because it makes it very intuitive to guess when destructors are being executed.