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

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

Thread Previous | Thread Next
Nick Wellnhofer via RT
March 14, 2017 04:08
[perl #32714] Objects destroyed in the wrong order during globaldestruction
Message ID:
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

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