Note that there are some explanatory texts on larger screens.

plurals
  1. POLeaking NSAutoreleasePool
    primarykey
    data
    text
    <p>I'm working on an app and have 1 leak left. The leaked object is NSAutoreleasePool, size is 32 bytes. In the stacktrace only foundation methods are called. I have no clue how to resolve this.</p> <p>In simulator no leaks reported, on the device only this leak.</p> <p>Any idea's?</p> <p>The autoreleasepool is one I define myself.</p> <p>In my viewcontroller I call:</p> <pre><code>[self performSelectorInBackground:@selector(getDetailInfo:) withObject:self.infoID]; </code></pre> <p>This is getDetailInfo:</p> <pre><code>- (void)getDetailInfo:(NSString *)theID { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; DetailInfo *info = [[DataProvider sharedInstance] getDetailInfo:theID]; //the return object is autoreleased. [self performSelectorOnMainThread:@selector(updateViewWithDetailInfo:) withObject:info waitUntilDone:NO]; [pool release]; } </code></pre> <p>Some additional info:</p> <p>For testing I changed all my methods which were called using performSelectorInBackground to run on the main thread and removed those autoreleasepools.</p> <p>I still received the leak on the NSAutoreleasePool. Today I learned that you can show the "Library name" in the stacktrace in instruments. :-) I copied it below and you can see the MapKit on line 6 and 7.</p> <pre><code>0 libSystem.B.dylib calloc 1 libobjc.A.dylib _internal_class_createInstanceFromZone 2 libobjc.A.dylib class_createInstance 3 CoreFoundation +[NSObject(NSObject) allocWithZone:] 4 Foundation +[NSAutoreleasePool allocWithZone:] 5 CoreFoundation +[NSObject(NSObject) alloc] 6 MapKit TileCachePrivate::runCacheThread() 7 MapKit _runCacheThread(void*) 8 libSystem.B.dylib _pthread_start 9 libSystem.B.dylib thread_assign_default </code></pre> <p>This the code for the mapview:</p> <pre><code> MKMapView *omgeving = [[MKMapView alloc] initWithFrame:CGRectMake(11, 22, 298, 297)]; omgeving.delegate = nil; [self addSubview:omgeving]; [omgeving release]; </code></pre> <p>If I comment out the MapView code, no leak. If I leave it in, I get the Leak.</p> <pre><code>Leaked Object # Address Size Responsible Library Responsible Frame NSAutoreleasePool 0x6a52e50 32 Foundation +[NSAutoreleasePool allocWithZone:] </code></pre> <p>Thanks for all the comments so far. Any suggestions?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload