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

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

Thread Previous | Thread Next
From:
Nick Wellnhofer via RT
Date:
March 14, 2017 04:08
Subject:
[perl #32714] Objects destroyed in the wrong order during globaldestruction
Message ID:
rt-4.0.24-1579-1489420329-680.32714-15-0@perl.org
On Mon, 13 Mar 2017 02:31:15 -0700, davem wrote:
> But has just been pointed out, freeing package vars before calling
> destructors breaks everything.

I realize that this problem is harder than I initially thought. But I think it could be solved by deferring freeing of package vars during global destruction. So if a refcount drops to zero, DESTROY is invoked, the object is not freed, but refcounts of other objects that are referred to are decreased. In other words, you simulate freeing an object just for refcount side effects. Then, in a second pass, DESTROY is invoked on objects that still have a refcount (because of circular references or refcount leaks).

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=32714

Thread Previous | 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