Re: The released object is not releasing memory
Re: The released object is not releasing memory
- Subject: Re: The released object is not releasing memory
- From: Scott Ribe <email@hidden>
- Date: Mon, 14 May 2007 09:14:11 -0600
- Thread-topic: The released object is not releasing memory
> I have checked for retainCount for "bmp" before releasing it. The retain
> count is 2.
Yes, it was probably retained by graphicsContextWithBitmapImageRep because
the context will need the rep during the context's lifetime. Note that
graphicsContextWithBitmapImageRep returns a context which has been
autoreleased, and therefore won't be freed, and therefore won't release its
reference to the rep, until after your code has run and control returns to
the event loop. (The setCurrentContext and restoreGraphicsState calls
probably retain and release the context you created, but they might retain
and autorelease.)
You need to stop trying to outguess the libraries' memory management and
study this until you understand it:
<http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/index.
html>
--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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