Re: Enabling NSZombieEnabled programatically
Re: Enabling NSZombieEnabled programatically
- Subject: Re: Enabling NSZombieEnabled programatically
- From: Dave Keck <email@hidden>
- Date: Sun, 10 Jan 2010 03:41:25 -1000
After checking the CF sources for 10.5
(http://opensource.apple.com/source/CF/CF-476.19/CFRuntime.c), it
would appear that the check for the NSZombieEnabled environment
variable comes in a GCC constructor. Therefore setting the
NSZombieEnabled environment variable from within your app's image
would be impossible (since the constructors for frameworks you link to
are executed before your own). I suppose you could create a framework
or dynamic library (that doesn't link CF directly or indirectly)
expressly for the purpose of setting the NSZombieEnabled environment
variable, but that's a little crazy.
Furthermore, CF couldn't be checking the NSZombieEnabled global
variable since it's defined in the higher-level Foundation framework.
For this reason, zombies could never be enabled for CF objects by
setting the NSZombieEnabled global in NSDebug.h. Which probably isn't
what you want.
These two facts combined means to my knowledge, there's no better way
to enable zombies than to relaunching your app.
(It would appear that 10.6 introduced _CFEnableZombies(), though...)
_______________________________________________
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