• 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: Problems with repetetive execution of netstat using NSTask and NSTimer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with repetetive execution of netstat using NSTask and NSTimer


  • Subject: Re: Problems with repetetive execution of netstat using NSTask and NSTimer
  • From: Kazior Fukacz <email@hidden>
  • Date: Tue, 6 Apr 2010 21:08:55 +0200

Thanks for your answers!

By the way, are you using garbage collection? If not, then you're leaking several objects (those pointed to by 'netstat', 'pipe', and 'string').

Yeah, I suspect that the pipes (and corresponding NSFileHandles) are indeed leaking, and that's the real problem. You may also want to create and launch NSTask instances inside an exception handler, since it and NSFileHandle/NSPipe can raise some unexpected exceptions.

I'm coding under Tiger using XCode 2.5. As far as I know garbage collection was introduced in XCode 3 which came with Objective-C 2.0, am I right?


Anyway, I tried putting a NSAutoreleasePool and draining it every time my method finishes its work. I also tried releasing the pipe manually. Still no luck.

However, putting "assert(pipe != null)" right before "[netstat setStandardOutput: pipe];" ended up with "(...)/IPShowX/IPShowX.m:32: failed assertion `pipe != nil'". It happened about 15 minutes after launching. This might be helpful in determining what the reason of this problem might be. As we can see it is NSPipe-related. Something about allocation, initialization and releasing?

How is it that it starts to malfunction after such amount of time?

Regards,
kaziorvb
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Problems with repetetive execution of netstat using NSTask and NSTimer
      • From: William Squires <email@hidden>
    • Re: Problems with repetetive execution of netstat using NSTask and NSTimer
      • From: "Adam R. Maxwell" <email@hidden>
References: 
 >Problems with repetetive execution of netstat using NSTask and NSTimer (From: Kazior Fukacz <email@hidden>)
 >Re: Problems with repetetive execution of netstat using NSTask and NSTimer (From: Ken Thomases <email@hidden>)
 >Re: Problems with repetetive execution of netstat using NSTask and NSTimer (From: "Adam R. Maxwell" <email@hidden>)

  • Prev by Date: copy/paste in modal window
  • Next by Date: Re: Problems with repetetive execution of netstat using NSTask and NSTimer
  • Previous by thread: Re: Problems with repetetive execution of netstat using NSTask and NSTimer
  • Next by thread: Re: Problems with repetetive execution of netstat using NSTask and NSTimer
  • Index(es):
    • Date
    • Thread