Re: Trouble with performSelector afterDelay
Re: Trouble with performSelector afterDelay
- Subject: Re: Trouble with performSelector afterDelay
- From: "James Trankelson" <email@hidden>
- Date: Mon, 14 Jul 2008 18:25:31 -0400
Hi Jens,
You're suggesting that my Worker instance is being deallocated because
it's retain count is going to zero after the performSelector is
invoked, right?
The funny thing about my Worker class is that it's a singleton,
implementing the following method:
- (unsigned)retainCount
{
return UINT_MAX; //Never release
}
Are there other ways objects can get released if not by retainCount?
-jt
On Mon, Jul 14, 2008 at 4:33 PM, Jens Alfke <email@hidden> wrote:
>
> On 14 Jul '08, at 11:53 AM, James Trankelson wrote:
>
>> #0 0x0002606d in -[Worker release] at Worker.m:155
>> #1 0x94e8502a in __delayedPerformCleanup
>> #2 0x9390d92b in CFRunLoopTimerInvalidate
>> #3 0x9390e879 in CFRunLoopRunSpecific
>> #4 0x9390ecf8 in CFRunLoopRunInMode
>> #5 0x94e734a5 in -[NSRunLoop(NSRunLoop) runMode:beforeDate:]
>> #6 0x000fea26 in -[Listener startAsyncListener:] at Listener.m:141
>
> It looks like the listener thread has just finished executing the delayed
> perform. The Worker object is probably being released because it was passed
> as one of the "withObject" arguments to the delayed-perform call, since
> those get retained until the perform finishes. The fact that this release is
> dealloc'ing the Worker means there must be some other unbalanced refcounting
> going on for that object. You should carefully look through the code the
> delayed perform is running to make sure all the retains and releases
> balance.
>
> —Jens
_______________________________________________
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