Re: Unwanted retain
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.