Re: Cocoa class extension best practice
Re: Cocoa class extension best practice
- Subject: Re: Cocoa class extension best practice
- From: Greg Parker <email@hidden>
- Date: Wed, 16 Oct 2013 01:25:45 -0700
On Oct 16, 2013, at 12:31 AM, Charles Srstka <email@hidden> wrote:
> I ask because if you're not using NSApplication's run loop, you won't get an automatic release pool, which would explain what you were seeing.
On sufficiently-recent OS versions, the runtime will silently push an autorelease pool if you autorelease without one. This can lead to unrecognized leaks if this happens on a long-lived thread. On some of those OS versions you can run with environment variable OBJC_DEBUG_MISSING_POOLS=YES to get a log message when this happens.
(History: Some OS version implemented this automatic pool behavior by accident. We chose to formally support it rather than take it away again and risk crashes in shipping apps.)
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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