• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Strange "autoreleased with no pool in place" message
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange "autoreleased with no pool in place" message


  • Subject: Re: Strange "autoreleased with no pool in place" message
  • From: email@hidden
  • Date: Sat, 17 Apr 2010 16:09:33 -0400

On Apr 17, 2010, at 3:39 PM, Alexander Bokovikov wrote:

>
> On 18.04.2010, at 1:30, Jens Alfke wrote:
>
>>
>> On Apr 17, 2010, at 12:18 PM, Alexander Bokovikov wrote:
>>
>>> *** _NSAutoreleaseNoPool(): Object 0x209fa0 of class NSCFString autoreleased with no pool in place - just leaking
>>
>> Set a breakpoint at _NSAutoreleaseNoPool and start the app. That should show you where it’s happening.
>
> I'm sorry... but how to do it? Where can I find this line? AFAIU, it is out of my source code... Sorry, I'm a newbie...
>
>> Most likely you started an NSThread without putting an autorelease pool in the thread’s main function, or you got a callback on some thread and are making Cocoa calls on it without wrapping your callback in an autorelease pool.
>
> Start NSThread even BEFORE main() ? Is it possible?


The first thing you need to do in your method that the thread calls is create an auto release pool. Something like:

-(void) createThread {
 NSThread *loadThread = [[NSThread alloc] initWithTarget:self selector:@selector(createSpreadSheetReport) object:nil];
            [loadThread start];
            [loadThread release];
}

- (void) createSpreadSheetReport {
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    [self.appModel spreadSheetReport];
    [self performSelectorOnMainThread:@selector(setSpreadsheetReport) withObject:self waitUntilDone:YES];
    [pool release];
}

Dave


_______________________________________________

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

References: 
 >Strange "autoreleased with no pool in place" message (From: Alexander Bokovikov <email@hidden>)
 >Re: Strange "autoreleased with no pool in place" message (From: Jens Alfke <email@hidden>)
 >Re: Strange "autoreleased with no pool in place" message (From: Alexander Bokovikov <email@hidden>)

  • Prev by Date: Re: Strange "autoreleased with no pool in place" message
  • Next by Date: Re: How to find all clipping siblings for a view?
  • Previous by thread: Re: Strange "autoreleased with no pool in place" message
  • Next by thread: Re: Strange "autoreleased with no pool in place" message
  • Index(es):
    • Date
    • Thread