Re: Malloc error: GC operation on unregistered thread...
Re: Malloc error: GC operation on unregistered thread...
- Subject: Re: Malloc error: GC operation on unregistered thread...
- From: Nick Zitzmann <email@hidden>
- Date: Tue, 8 Sep 2009 20:57:25 -0600
On Sep 7, 2009, at 4:35 PM, Andrew Madsen wrote:
My app doesn't crash, and everything seems to work OK, but I'm
trying to figure out what this means. This is my first garbage
collected app, so I'm guessing there's something about the
intricacies of actually using garbage collection that I'm missing.
Any pointers?
It's caused by a change made to Snow Leopard. In Leopard, if you
created a thread outside of NSThread or NSOperationQueue (e.g. with
the pthread functions), then the thread would quietly be implicitly
registered for GC. In Snow Leopard, it's still registered implicitly,
but now the runtime whines to you about it.
There's a function you can call that gets rid of the whine, called
objc_registerThreadWithCollector(). However, the function is only
present in the 10.6 SDK AFAICT, so this may not be an option if you
still need to target Leopard. If you do, then just ignore the warning,
or create the thread with NSThread if that would be possible.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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