Re: cocoa context and autorelease pools
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