• 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: "Julien Jalon" <email@hidden>
  • Date: Sun, 26 Oct 2008 21:33:20 +0100

self.foregroundColor = nil
in your -dealloc is totally useless (and in this case, it's even logging
some error log!). Taking care of foregroundColor is you superclass
responsibility. You are only responsible of the object YOU create or retain
(that's why the temp pattern is indeed the right one)

>In the documentation, the foregroundColor property is defined like this:
>
>       @property CGColorRef foregroundColor
>
>There's no retain parameter.

because CGColorRef is not an ObjC type so it would confuse the compiler, but
you can consider it's there.

For Charles:

> Because otherwise there won't be a release to balance the retain in the in
setForgroundColor:. See the docs on Objective-C memory management:

since you don't do that "retain" you are clearly not the one responsible to
do any retain... as you mentioned: see the docs.
_______________________________________________

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

References: 
 >Leaking CGColor objects (From: DKJ <email@hidden>)
 >Re: Leaking CGColor objects (From: "Clark Cox" <email@hidden>)
 >Re: Leaking CGColor objects (From: DKJ <email@hidden>)

  • Prev by Date: Re: Newbie: Referencing Objects
  • Next by Date: Re: Newbie: Referencing Objects (second try)
  • Previous by thread: Re: Leaking CGColor objects
  • Next by thread: Finding out that a volume is going away before it does
  • Index(es):
    • Date
    • Thread