Re: NSTask Leaking...
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