• 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: Creating many NSPipes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating many NSPipes


  • Subject: Re: Creating many NSPipes
  • From: Jerry Krinock <email@hidden>
  • Date: Tue, 25 Jul 2006 10:02:39 -0700
  • Thread-topic: Creating many NSPipes

on 06/07/25 7:42, Thom McGrath at email@hidden wrote:

> I'm attempting to run a shell script many times (in the hundreds) and
> need to read the output. So I create the NSPipe and all, but after so
> many, it starts returning nil. I have tried releasing the NSPipe when
> I'm done with it, but that doesn't help. It seems like I'm running
> out of memory or something. How can I solve this problem?

I ran into this problem last year.  It was not sufficient to release the
NSPipes because I was also getting file handles (NSFileHandle) for each one
using -fileHandleForReading.  According to the documentation, these file
handles are "automatically" released when the pipe is deallocated.  Read
carefully "automatically" <=> "autoreleased".  Implementing a local
autorelease pool and releasing it with each NSPipe solved the problem.


 _______________________________________________
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

References: 
 >Creating many NSPipes (From: Thom McGrath <email@hidden>)

  • Prev by Date: Re: A rant and a question...
  • Next by Date: Re: A rant and a question...
  • Previous by thread: Creating many NSPipes
  • Next by thread: A rant and a question...
  • Index(es):
    • Date
    • Thread