Re: Leaking CGColor objects
Re: Leaking CGColor objects
- Subject: Re: Leaking CGColor objects
- From: Charles Steinman <email@hidden>
- Date: Sun, 26 Oct 2008 12:44:13 -0700 (PDT)
--- On Sun, 10/26/08, DKJ <email@hidden> wrote:
> On 26 Oct, 2008, at 12:09, Clark S. Cox III wrote:
> > You must do both, otherwise you will leak.
>
>
> I understand why I have to release the temp object, but why
> does it
> leak if I don't set foregroundColor to nil as well?
Because otherwise there won't be a release to balance the retain in the in setForgroundColor:. See the docs on Objective-C memory management:
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html
Cheers,
Chuck
_______________________________________________
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