• 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: NSTask Leaking...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTask Leaking...


  • Subject: Re: NSTask Leaking...
  • From: "Stephen J. Butler" <email@hidden>
  • Date: Thu, 29 Jan 2009 12:31:03 -0600

On Thu, Jan 29, 2009 at 12:20 PM, Mr. Gecko <email@hidden> wrote:
>        [theTask setStandardOutput:[outPipe autorelease]];

The autorelease here is wrong...

>        [theTask setLaunchPath:@"/sbin/md5"];
>        [theTask setCurrentDirectoryPath:@"~/"];
>        [theTask setArguments:[[NSArray arrayWithObjects:@"-s", MD5, nil]
> autorelease]];

Along with here...

>        [theTask launch];
>        [theTask waitUntilExit];
>        NSString *rMD5 = [[[[NSString alloc] initWithData:[[outPipe
> fileHandleForReading] readDataToEndOfFile] encoding: NSUTF8StringEncoding]
> componentsSeparatedByString:@" = "] objectAtIndex:1];
>        [theTask release];
>
>        rMD5 = [self replace:@"\n" with:@"" source:rMD5];
>
>        return [rMD5 autorelease];

And here. Maybe. I don't know what your replace:with:source method does.

But there are better ways to get the MD5 of some data:

<http://www.cocoadev.com/index.pl?MDFive>
_______________________________________________

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

References: 
 >NSTask Leaking... (From: "Mr. Gecko" <email@hidden>)

  • Prev by Date: Re: NSTask Leaking...
  • Next by Date: Re: NSTask Leaking...
  • Previous by thread: Re: NSTask Leaking...
  • Next by thread: Re: NSTask Leaking...
  • Index(es):
    • Date
    • Thread