in reply to Re^2: Writing a REAL destructor
in thread Writing a REAL destructor
What I was saying is that as far as I know, when the ref count goes to 0, the object may not be swept right away; while if you bring the ref count down to 0 explicitly with an undef on the last reference, then it will be collected immediately.
What do you mean? First you say that if the ref count goes to 0, the object may not be swept right away (which isn't true - this is perl5, not perl6 nor Java), but if you undef the last reference, the ref count goes to 0 and it gets destroyed.
That doesn't make any sense. Either the object is collected if the ref count goes to 0, or it isn't. But how the ref count goes to 0 doesn't matter.
But in perl5, the object is collected right after the ref count goes to 0.
Abigail
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Writing a REAL destructor
by Aristotle (Chancellor) on Jun 05, 2002 at 18:11 UTC |