Re: Leaking CGColor objects
Re: Leaking CGColor objects
- Subject: Re: Leaking CGColor objects
- From: "Clark S. Cox III" <email@hidden>
- Date: Sun, 26 Oct 2008 12:09:56 -0700
You must do both, otherwise you will leak.
Sent from my iPhone
On Oct 26, 2008, at 10:58, DKJ <email@hidden> wrote:
Thanks to everyone for the replies. I have one (hopefully last)
question (on this topic):
On 26 Oct, 2008, at 09:23, Clark Cox wrote:
As long as MyCALayer's dealloc is properly implemented (to release
foregroundColor, or set it to nil), you should never need to
explicitly do so in code that uses MyCALayer.
If I do this in MyCALayer's dealloc:
self.foregroundColor = nil;
do I need to do this in init:
CGColorRef temp = CGColorCreateGenericRGB( etc. );
self.foregroundColor = temp;
CFRelease( temp );
or can I just do this:
self.foregroundColor = CGColorCreateGenericRGB( etc. );
For the time being, I'll do both.
_______________________________________________
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