Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory leak.



On Aug 30, 2005, at 10:48 AM, Shawn Erickson wrote:
In general you should never need to send dealloc directly yourself but instead depend on reference counting support provided by retain / release / autorelease to do that for you.

A little bit stronger statement is in order here.

You should never, not ever, invoke -dealloc in your code anywhere but in the implementation of your own object's dealloc message and, in that case, only to invoke [super dealloc].

If you ever write code like [someRandomObject dealloc], it is wrong.

b.bum
(No, really, I can't think of a single spot where invoking -dealloc directly is the right answer. I may have missed something, but I don't believe so.)


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/objc-language/email@hidden

This email sent to email@hidden
References: 
 >Memory leak. (From: "Brian O'Brien" <email@hidden>)
 >Re: Memory leak. (From: Shawn Erickson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.