Re: Garbage Collection, Standard Out, NSTask
Re: Garbage Collection, Standard Out, NSTask
- Subject: Re: Garbage Collection, Standard Out, NSTask
- From: Jon Gilkison <email@hidden>
- Date: Tue, 16 Nov 2010 13:39:32 -0500
That was it, though further up the chain. The object that created/owned the task was being GC'd away.
Thanks Bill and Quincy!
On Nov 16, 2010, at 12:53 PM, Bill Bumgarner wrote:
> The issue [I'd bet -- don't have time to dive deep] is that you don't have a strong reference to the Tasker instance.
>
> Since notification observers don't hold strong references to observers, either, the garbage collector sees Tasker as garbage and collects it.
>
> You could fix this any number of ways;
>
> - keep a reference to the Tasker instance as an iVar
> - keep a global set around of "active taskers" and have 'em remove themselves when they are done
> - use CFRetain or the NSGarbageCollector API to tell the collector not to collect the tasker before done.
>
> b.bum
_______________________________________________
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