Re: Leaking CGColor objects
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