Re: static method to create CABasicAnimation: does this create a memory leak?
Re: static method to create CABasicAnimation: does this create a memory leak?
- Subject: Re: static method to create CABasicAnimation: does this create a memory leak?
- From: Randall Meadows <email@hidden>
- Date: Thu, 9 Apr 2009 18:20:46 -0600
On Apr 9, 2009, at 6:00 PM, Miles wrote:
I have created a static method creating and returning an animation
that I
use in various places in my application. I think this may be causing
a leak.
If I autorelease theAnimation in the return statement I get a crash
because
I the animation must be being release before it's complete.
Right, because "theAnimation" is *already* autoreleased. The method
"animationWithKeyPath" does not contain "new", "alloc", or "copy",
therefore you do not own the object, and therefore you are not
responsible for (auto)releasing it.
Is this indeed causing a leak?
No.
Might I suggest you review <http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmObjectOwnership.html#//apple_ref/doc/uid/20000043
>.
_______________________________________________
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