Re: Garbage collection and compiling of non GC framework (MCPKit library)
Re: Garbage collection and compiling of non GC framework (MCPKit library)
- Subject: Re: Garbage collection and compiling of non GC framework (MCPKit library)
- From: Nick Zitzmann <email@hidden>
- Date: Wed, 3 Sep 2008 15:58:11 -0600
On Sep 3, 2008, at 2:11 PM, matt wrote:
Is there any way of using a non GC bundled framework in a GC app?
There isn't, sorry.
Otherwise... Does anyone have any information on compiling the
MCPKit framrwork ?
I haven't ever built that framework, but having done some work with GC-
enabled frameworks, it is not always as easy as flipping a switch.
Yes, you can just turn on GC in the configuration settings, however:
1. You must also write -finalize methods for classes that have to free
up C data structures, C++ classes, etc. when the object would normally
be deallocated. Otherwise you'll have memory leaks.
2. Stuff that normally wouldn't retain an object without GC
(delegates, timers and other run loop stuff, etc.) _will_ retain an
object with GC on. So if the class adds itself to the run loop
repeatedly (timers, etc.), then you're going to have to figure out a
reliable way of stopping this behavior outside of -dealloc or else the
object will live forever. NSNotifications are the exception.
There are a couple of other things to keep in mind, but those are the
main two.
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