On 2010 Aug 23, at 19:02, Daniel DeCovnick wrote:

> But it doesn't really matter since you should never be calling dealloc except 
> from release or dealloc (as [super dealloc];) anyway.

No, I haven't called -dealloc for quite a few years  :)

Actually, I was studying Uli Kusterer's old UKKQueue.  One of his instances 
detaches a secondary thread with the instance itself as target, creating a kind 
of retain cycle:  The secondary thread won't exit until the instance is 
deallocced, and the instance won't be deallocced until the secondary thread 
exits.  To fix this, he overrode -release, and messages (via ivar) the 
secondary thread to exit when the pre-release retainCount == 2.  I believe it 
is a pretty neat trick, but couldn't understand it until I corrected Apple's 
documentation of -release.

Document Feedback has been submitted on -release.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to