Re: Unwanted retain
Re: Unwanted retain
- Subject: Re: Unwanted retain
- From: Clark Cox <email@hidden>
- Date: Thu, 5 Feb 2004 08:44:06 -0500
On 2004/02/05, at 1:36, b.bum wrote:
>
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.
Actually, as I understand it, when you schedule the timer, and it is
added to the run loop, the run loop retains it. When you call
invalidate (thereby removing it from the runloop), the runloop does
indeed release the timer. So unless you explicitly retain the timer,
there is no need to release it as that will be taken care of by
invalidate.
--
Clark S. Cox III
email@hidden
http://homepage.mac.com/clarkcox3/
http://homepage.mac.com/clarkcox3/blog/B1196589870/index.html
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.