Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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

Replies are listed 'Best First'.
Re^3: Controlling the order of object destruction
by Crackers2 (Parson) 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?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2016-10-01 16:16 GMT
Find Nodes?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:

    Results (579 votes). Check out past polls.