Re: NSCFArray autoreleased with no pool in place
Re: NSCFArray autoreleased with no pool in place
- Subject: Re: NSCFArray autoreleased with no pool in place
- From: Tron Thomas <email@hidden>
- Date: Thu, 14 May 2009 21:58:31 -0700
Clark Cox wrote:
On Thu, May 14, 2009 at 6:43 PM, Tron Thomas <email@hidden> wrote:
I am writing a Cocoa application that links to many frameworks. For some
reason when I debug the program the following message appears in the debug
output:
*** _NSAutoreleaseNoPool(): Object 0x409660 of class NSCFArray autoreleased
with no pool in place - just leaking
This message is occurring before the main function for the application is
executed. Suspicions are that something in one of the frameworks that gets
loaded is causing the problem.
What can be done to track down where this problem is occurring and fix it?
Set a breakpoint in _NSAutoreleaseNoPool
That did the trick. The stack trace allowed me to track down the cause
of the error. Because Objective-C++ does not have a concept of class
static variables I had an NSArray defined in an anonymous namespace in
the implementation module that was initializing its contents. I changed
the code so the array is initially set to nil in the anonymous
namespace, and then assign it to an NSArray instance the init method of
the class using the array if the array had not been initialize.
Thanks for the help.
_______________________________________________
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