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

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

Thread Next
From:
Nick Wellnhofer via RT
Date:
March 10, 2017 08:31
Subject:
[perl #32714] Objects destroyed in the wrong order during globaldestruction
Message ID:
rt-4.0.24-31077-1489092922-674.32714-15-0@perl.org
On Thu, 07 Jul 2016 09:49:52 -0700, dcollinsn@gmail.com 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
https://rt.perl.org/Ticket/Display.html?id=32714

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About