Re: multithreading, cocoa, pools and POSIX
Re: multithreading, cocoa, pools and POSIX
- Subject: Re: multithreading, cocoa, pools and POSIX
- From: Philip George <email@hidden>
- Date: Tue, 7 Jun 2005 12:31:38 -0500
when you use the alloc/initXXX pair, **you** deal with cleanup.
otherwise (as in your case), just make sure there's an available
autorelease pool, which you've got.
- philip
On Jun 7, 2005, at 12:28 PM, Luc Vandal wrote:
Ok!
I did that according to the sample given in the "Autorelease Pool" doc:
void main()
{
NSArray *args = [[NSProcessInfo processInfo] arguments];
unsigned count, limit = [args count];
for (count = 1; count < limit; count++){
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *fileContents;
NSString *fileName;
fileName = [args objectAtIndex:count];
fileContents = [[NSString alloc]
initWithContentsOfFile:fileName];
[fileContents autorelease];
/* Process the file, creating and autoreleasing more objects.
*/
[pool release];
}
/* Do whatever cleanup is needed. */
exit (EXIT_SUCCESS);
}
Luc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden