clipka <ano### [at] anonymous org> wrote:
> Then again, how would any other GC prevent this kind of thing happening?
A GC keeps track of *all* the references that are pointing to an object,
including the 'this' pointer (or whatever the equivalent is in any given
language).
You could avoid this problem in a reference-counted scenario by
incrementing the reference count in the beginning of the function and
decrementing it when exiting the function, but that's burdensome and
makes member functions less efficient (especially if they are supposed
to be fast).
--
- Warp
Post a reply to this message
|