Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

(tye)Re2: non-deterministic destructors?

by tye (Sage)
on Nov 10, 2001 at 01:20 UTC ( [id://124481]=note: print w/replies, xml ) Need Help??


in reply to Re: (tye)Re: non-deterministic destructors?
in thread non-deterministic destructors?

Yes, but if anyone holds a reference to that same object in a global or in something that is referenced by something that is referenced by something... that is in a global, then destruction will be delayed until the ominously named "global destruction phase", at which point objects are destroyed in a "random" order.

For example, closures aren't cleaned up until "the end" (even if you no longer hold a reference to them since Perl itself creates a references loop when it creates closures -- this bug has been fixed but I don't think the fix is in a stable release of Perl yet). Or perhaps ExcelTable keeps a list of objects that it has created.

You could use Devel::Peek to see the reference count of what $table refers to. That would give you a hint if something else is keeping a reference to it (or perhaps you have an XS bug that is leaving the reference count on the other object too low so that it actually is getting destroyed early, tho that seems unlikely -- such XS bugs usually leave the ref count too high, which could be another reason why destruction of your main object is delayed).

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re2: non-deterministic destructors?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://124481]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-24 11:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found