• 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: NSTimer never being deallocated
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTimer never being deallocated


  • Subject: Re: NSTimer never being deallocated
  • From: Gordon Apple <email@hidden>
  • Date: Sat, 13 Mar 2010 14:45:44 -0600
  • Thread-topic: NSTimer never being deallocated

I haven't followed this whole thread, but my experience is that an NSTimer
(especially a repetitive one) is an easy thing to leak, even in a GC
environment (which I use).  To prevent it, you have to make sure you keep a
reference to the timer so that you can actually invalidate it, taking it out
of the run loop.  Otherwise, it stays there forever.


On 3/13/10 2:02 PM, "email@hidden"
<email@hidden> wrote:

> For the benefit of the OP, according to the docs (and this fits in with my own
> experience), calling [NSTimer invalidate] will release the timer at some
> future point in the run loop and is in fact the only way to get rid of it.  So
> there is really nothing to worrry about.  Trust in Papa Cocoa, all will be
> well.



_______________________________________________

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

  • Prev by Date: -[QCNSBitmapImageRep encodeWithCoder:]: Inconsistent state
  • Next by Date: Re: NSTimer never being deallocated
  • Previous by thread: Re: NSTimer never being deallocated
  • Next by thread: death in dealloc
  • Index(es):
    • Date
    • Thread