• 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: cocoa context and autorelease pools
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cocoa context and autorelease pools


  • Subject: Re: cocoa context and autorelease pools
  • From: Scott Ribe <email@hidden>
  • Date: Tue, 18 Dec 2007 23:18:34 -0600
  • Thread-topic: cocoa context and autorelease pools

Also, you have no way of creating an autorelease pool before main or before
a library's entry point is called, so any case of a static variable being
initialized with an Objective-C instance can give you those kinds of
messages at startup. Three options:

- Don't use statics for Objective-C instances.

- Avoid convenience methods that autorelease, instead use alloc & initXXX
methods.

- Just live with a few messages in the console. Presumably objects assigned
to statics are going to survive the entire process lifespan anyway, so the
fact that if you were to not retain them they wouldn't be disposed would not
be a problem. Of course, if this is not the case, and the objects should be
released and the statics set to point to different objects, then you would
have an actual leak.

--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice


_______________________________________________

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

References: 
 >Re: cocoa context and autorelease pools (From: "Wesley Smith" <email@hidden>)

  • Prev by Date: Re: How to use NSMutableArray's filteredArrayUsingPredicate
  • Next by Date: Re: Dir of app
  • Previous by thread: Re: cocoa context and autorelease pools
  • Next by thread: Options for working around a bug
  • Index(es):
    • Date
    • Thread