On Apr 11, 2007, at 9:25 PM, [EMAIL PROTECTED] wrote: > On Apr 12, 2007, at 00:10 UTC, William Squires wrote: > >> Or you could simply set the parent reference to nil in Egg::~Egg() >> (i.e. the destructor.) > > No, there is never any point in setting an object's own properties to > nil in its destructor. When an object dies, any and all references it > holds are released anyway. > >> Now when the EggCarton doesn't need an Egg >> instance anymore, it just sets it to nil, and allows it to die. > > That would work just fine without the destructor. The problem being > discussed is when you no longer need an entire carton of eggs, and > release your last handy reference to EggCarton. The EggCarton will > not > die, because all the Eggs still refer to it; and the Eggs will not > die, > because the EggCarton refers to each of them. Unless you use a > WeakRef, or first call some sort of explicit disposal method. > So what the heck is a weak ref, and how does it work, anyway? Is it like Cocoa's autorelease pool?
> Best, > - Joe > > P.S. Please remember to trim the quoted material you're replying to. > Thanks! > > -- > Joe Strout -- [EMAIL PROTECTED] > Verified Express, LLC "Making the Internet a Better Place" > http://www.verex.com/ > > _______________________________________________ > Unsubscribe or switch delivery mode: > <http://www.realsoftware.com/support/listmanager/> > > Search the archives: > <http://support.realsoftware.com/listarchives/lists.html> _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
