develooper Front page | perl.perl5.porters | Postings from December 2004

Re: [perl #32714] Objects destroyed in the wrong order during glo bal destruction

Mark Jason Dominus
December 2, 2004 10:16
Re: [perl #32714] Objects destroyed in the wrong order during glo bal destruction
Message ID:
> Only in normal destruction. It _cant_ make the guarantee that you say it
> does or circular structures would never be broken during global destruction:

Yes, you're right.  But in this case there is no circular structure.

As I mentioned to Christoph Haas, our surprise at this situation might
be the result of our misunderstanding of global destruction semantics.
I am still willing to admit that, but it also seems to me that the
present behavior is unnecessarily bad.

> That's why I was suggesting the counter approach. At least then you could
> know that the objects would be destroyed in a defined order.

I misunderstood your suggestion.  Thanks for explaining it.

It still seems to me that Perl's final destruction should have a first
pass in which objects are destroyed normally, in
reference-count-order, followed by a second pass to take care of any
remaining circularly-referenced objects.  Or alternatively, that the
outer object in my example should be destroyed at the end of program
execution, but before the global destruction paqhse is initiated. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About