• 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: static method to create CABasicAnimation: does this create a memory leak?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >static method to create CABasicAnimation: does this create a memory leak? (From: Miles <email@hidden>)

  • Prev by Date: Re: Send click to window
  • Next by Date: Re: NSURLConnection crashes with EXC_BAD_ADDRESS -- can't find why...
  • Previous by thread: static method to create CABasicAnimation: does this create a memory leak?
  • Next by thread: Re: static method to create CABasicAnimation: does this create a memory leak?
  • Index(es):
    • Date
    • Thread