• 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: multithreading, cocoa, pools and POSIX
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: multithreading, cocoa, pools and POSIX
      • From: Luc Vandal <email@hidden>
References: 
 >Re: multithreading, cocoa, pools and POSIX (From: Will Mason <email@hidden>)
 >Re: multithreading, cocoa, pools and POSIX (From: Luc Vandal <email@hidden>)

  • Prev by Date: Re: multithreading, cocoa, pools and POSIX
  • Next by Date: Re: multithreading, cocoa, pools and POSIX
  • Previous by thread: Re: multithreading, cocoa, pools and POSIX
  • Next by thread: Re: multithreading, cocoa, pools and POSIX
  • Index(es):
    • Date
    • Thread