Re: Release autoreleased object now
Re: Release autoreleased object now
- Subject: Re: Release autoreleased object now
- From: Kyle Sluder <email@hidden>
- Date: Fri, 8 Oct 2010 10:11:40 -0700
On Oct 8, 2010, at 9:58 AM, Jonny Taylor <email@hidden> wrote:
> The problem is coming from OS functions such as [image TIFFRepresentation] that return autoreleased objects, so it is obviously considered ok to autorelease large chunks of memory. My question is whether I can tell the OS to release the memory *now* rather than waiting until the pool is drained. At the moment I am bracketing the relevant parts with my own autorelease pools, but that is getting a bit tedious. I would like just to be able to call [imageRep releaseNow] or something. I suspect that just calling 'release' on the autoreleased memory would be a Bad Idea.
No, you cannot force an autorelease pool to release its contents without calling -drain. Wrapping the autorelease-intensive portions of your code is the correct approach.
--Kyle Sluder_______________________________________________
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