• 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: Am I overreleasing something?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Am I overreleasing something?


  • Subject: Re: Am I overreleasing something?
  • From: "Theodore H. Smith" <email@hidden>
  • Date: Sat, 11 Jun 2005 13:00:48 +0100


On 10 Jun 2005, at 20:55, Shawn Erickson wrote:


On Jun 10, 2005, at 10:03 AM, Theodore H. Smith wrote:

I didn't quite mean it to that extreme, that would be silly. I meant more like this within my own code:

Obj = [[MyClass alloc] init];
[Obj doStuff];
[Obj release];

Actually doing the following...

Obj = [[[MyClass alloc] init] autorelease];
[obj doStuff];

...can be safer and cleaner code wise (avoids exit point before your release causing a leak, etc.). I usually use autorelease unless I am worried about performance overhead or having a large object hang around longer then minimally needed.

If you are having problems using autorelease correctly you will have problems using release correctly (they aren't really that different). For tracking down bugs use ObjectAlloc.app (OmniGroup folks also have a good tool called OmniObjectMeter.app) and/or NSZombie functionality instead of changing away from potentially good coding practices.

How do I use ObjectAlloc to track down autorelease problems? Is there a trick for it, or documentation I can read?


--
http://elfdata.com/plugin/ Industrial strength string processing, made easy.


"All things are logical. Putting free-will in the slot for premises in
a logical system, makes all of life both understandable, and free."

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Am I overreleasing something?
      • From: Shawn Erickson <email@hidden>
References: 
 >Am I overreleasing something? (From: "Theodore H. Smith" <email@hidden>)
 >Re: Am I overreleasing something? (From: Glen Simmons <email@hidden>)
 >Re: Am I overreleasing something? (From: "Theodore H. Smith" <email@hidden>)
 >Re: Am I overreleasing something? (From: Glen Simmons <email@hidden>)
 >Re: Am I overreleasing something? (From: Ondra Cada <email@hidden>)
 >Re: Am I overreleasing something? (From: "Theodore H. Smith" <email@hidden>)
 >Re: Am I overreleasing something? (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Don't compile on XCode 2.1
  • Next by Date: Re: Updates from Download
  • Previous by thread: Re: Am I overreleasing something?
  • Next by thread: Re: Am I overreleasing something?
  • Index(es):
    • Date
    • Thread