• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Adding PDFPage to PDFDocument crashes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding PDFPage to PDFDocument crashes


  • Subject: Re: Adding PDFPage to PDFDocument crashes
  • From: Paul Archibald <email@hidden>
  • Date: Tue, 2 Sep 2008 20:13:12 -0700

I really like that rule of thumb. Very clean, very cool. Thanks. (I am not too worried about overhead in this case.)

Paul


On Sep 2, 2008, at 7:00 PM, email@hidden wrote:


And if you do use autorelease, then put it right where you allocate the object. For example:

NSTextView* view = [[[NSTextView alloc] initWithFrame:r] autorelease];

The advantage of this is that it places all of your memory management
right in the same place. It's much harder to forget to release
something if you use an autorelease right when you create the object
instead of using a release farther down. This also saves you from
accidentally leaking if you return from the middle of the function or
throw an exception.

However, as you say, this does have some extra overhead and can make
some bugs harder to find, so it's something of a tradeoff.

Mike

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Prev by Date: [OT] curious about the iPhone dev program
  • Next by Date: Re: basic Core Data scaling question
  • Previous by thread: Re: Adding PDFPage to PDFDocument crashes
  • Next by thread: Detecting File Existence over FTP
  • Index(es):
    • Date
    • Thread