Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Controlling the order of object destruction

by metaperl (Curate)
on Dec 10, 2009 at 17:17 UTC ( #812249=note: print w/ replies, xml ) Need Help??


in reply to Re: Controlling the order of object destruction
in thread Controlling the order of object destruction

I am not sure (but could be wrong)
yes, I'm not sure either. I appreciate your input. I definitely want a reference in the docs if possible.
all that is guaranteed is that an object may (note that I didn't say will) only be destroyed when there is no longer a reference pointing to it.
yes, that's why I used braces in the second part of the code - to control the order of reference loss.


Comment on Re^2: Controlling the order of object destruction
Re^3: Controlling the order of object destruction
by Crackers2 (Vicar) on Dec 10, 2009 at 18:36 UTC

    Neither MidLifeXis nor ikegami's statements seem to imply a guarantee that an object will be immediately be destroyed when the last reference goes away though.

    So even in your second case it would be in theory possible that the objects are freed in a different order than what you're expecting.

    So there still two questions that might be interesting: 1) does the spec mandate object destruction as soon as there's no reference left; and 2) do all current implementations (including Activestate) behave the same way?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2014-09-30 19:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (381 votes), past polls