Re: NSTableView and check boxes (for the hundredth time)
Re: NSTableView and check boxes (for the hundredth time)
- Subject: Re: NSTableView and check boxes (for the hundredth time)
- From: j o a r <email@hidden>
- Date: Thu, 3 Oct 2002 23:29:52 +0200
I don't think you should always use autorelease instead of release, so
I'll have to comment on that...
* Don't autorelease when you can release
It is easier to debug your application if you don't use autorelease -
retain count errors will show up in the right context and not when the
autorelease pool is released. There is also a slight performance
overhead when using autorelease instead of a plain release.
* Don't expect exceptions
If you get exceptions in your running program in a code segment like
the one discussed here, the tiny memory leak is of little importance.
The reason for the exception should be tracked down before this code is
finalized and shipped. In some other context where exceptions might be
the result of normal operations you should make sure to catch them
properly - there is no substitute for that.
j o a r
On Thursday, Oct 3, 2002, at 21:46 Europe/Stockholm, Brent Gulanowski
wrote:
I'll save Ondra the trouble by adding that you should autorelease
immediately upon init, avoiding the danger of memory leak due to
uncaught exception which might be raised in between separated init and
release messages.
(protoCell = [[[NSButtonCell alloc] init] autorelease]; )
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.