Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Main autorelease pools only releases when app closes?


int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}


This main autorelease pool that handles all my autoreleased objects in the main thread, does it only release its objects when my app is finished?

If that's the case, then can't my app crash if the user uses it for a long time since those autoreleased objects are only released when the app finally closes?

Thanks

Message was edited by: applehund

macbook, Mac OS X (10.5.4)

Posted on Sep 22, 2008 12:11 AM

Reply
16 replies

Main autorelease pools only releases when app closes?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.