in reply to Re^7: when is destroy function called
in thread when is destroy function called

Athanasius:

Your code and analysis look alright with me. But I'll have to dig more to go much further. I may have to download your code this evening and give it a try. I'm kind of curious if not marking them as mortal would cause them to die in the FREETMPS area.

It's pretty darned interesting, though. Hopefully someone with good internals knowledge will chime in. (bulk88, you there?)

Update: I reworded it a little.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^9: when is destroy function called
by bulk88 (Priest) on Apr 21, 2013 at 03:48 UTC
    Mortals are freeded at the next ";" or next "}" scope end. Not sure about scope opens("{"). DESTROYs will run when the ";" is executed, not at commas and not at sub calls (callee gets a new mortal scope, i am talking about caller scope) in the statement. This can cause headaches when you assign a new obj to a scalar that held a ref to an old obj, depending on the design of the class/api/library, the old obj can change global state set by new obj, so when you do something that involves global state, you wont see the action of new obj, but of old obj.