• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Leaking CGColor objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Leaking CGColor objects


  • Subject: Re: Leaking CGColor objects
  • From: DKJ <email@hidden>
  • Date: Sun, 26 Oct 2008 10:58:34 -0700

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


  • Follow-Ups:
    • Re: Leaking CGColor objects
      • From: "Julien Jalon" <email@hidden>
    • Re: Leaking CGColor objects
      • From: Charles Steinman <email@hidden>
    • Re: Leaking CGColor objects
      • From: "Clark S. Cox III" <email@hidden>
References: 
 >Leaking CGColor objects (From: DKJ <email@hidden>)
 >Re: Leaking CGColor objects (From: "Clark Cox" <email@hidden>)

  • Prev by Date: Re: Just starting off in obj C
  • Next by Date: Newbie: Referencing Objects
  • Previous by thread: Re: Leaking CGColor objects
  • Next by thread: Re: Leaking CGColor objects
  • Index(es):
    • Date
    • Thread