• 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: Unwanted retain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unwanted retain


  • Subject: Re: Unwanted retain
  • From: "b.bum" <email@hidden>
  • Date: Wed, 4 Feb 2004 22:36:33 -0800

On Feb 4, 2004, at 5:55 PM, Dustin Voss wrote:
> Also, do not call [renderTimer release]. [renderTimer invalidate] will
> take care of that for you. The documentation does not make this clear,
> though it should.

Not true. If -invalidate released the timer, it would violate the
retain/release rules that started this whole conversation.

[renderTimer invalidate] is documented as:

Stops the receiver from ever firing again and removes it from any run
loops. This is the only way to remove a timer from an NSRunLoop.

The receiver releases its references to the target and userInfo objects
at this point.

---

If you want to properly ditch a timer from your object -- a timer that
had been previously retained -- then this is the way to do it:

[renderTimer invalidate];
[renderTimer release];
renderTimer = nil; //! not necessary, but makes it impossible message a
dealloc'd object later.

b.bum
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Unwanted retain
      • From: Clark Cox <email@hidden>
References: 
 >Re: Unwanted retain (From: Lorenzo <email@hidden>)
 >Re: Unwanted retain (From: Dustin Voss <email@hidden>)

  • Prev by Date: Re: NSDate
  • Next by Date: Re: NSDate
  • Previous by thread: Re: Unwanted retain
  • Next by thread: Re: Unwanted retain
  • Index(es):
    • Date
    • Thread