--- On Sun, 10/26/08, DKJ <[EMAIL PROTECTED]> wrote:

> 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.

You need to do both. Consider CGColorCreateGenericRGB() as being equivalent to 
an [[NSObject alloc] init]. You need a release to balance it. This actually 
applies to all CFTypeRef-type objects -- they need to be released or they'll 
leak.

Cheers,
Chuck


      
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to