develooper Front page | perl.perl5.porters | Postings from March 2017

[perl #32714] Objects destroyed in the wrong order during globaldestruction

Thread Next
Nick Wellnhofer via RT
March 10, 2017 08:31
[perl #32714] Objects destroyed in the wrong order during globaldestruction
Message ID:
On Thu, 07 Jul 2016 09:49:52 -0700, wrote:
> Based on the above suggestions to make a pragma and upload it to cpan,
> and the report that Liz has done so, I believe this ticket can be
> closed? I intend to close resolved in a week unless there is some
> objection.

I object to closing this bug. Perl really should run global destruction in two phases:

1. Decrease the refcount of globals like "our" variables which will run destructors in correct order unless there are circular references or refcount leaks.

2. Only then forcibly destroy the remaining objects.

Ideally, it should be possible to tell which of the two phases is run. Some code may want to skip forced destruction in phase 2.

There's no need for a pragma that adds additional overhead. Besides, "use ogd" doesn't seem to be very useful. In most cases you don't want LIFO order, but make sure that an object that is still referred to isn't destroyed before the referrer.

via perlbug:  queue: perl5 status: resolved

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About