Use a task (that is properly disposed of) for reading the rev list

This commit is contained in:
Bryce Kerley
2008-11-17 14:49:45 -05:00
parent 146db09ea4
commit 8f2cc570f5
+4 -1
View File
@@ -88,7 +88,9 @@
if ([rev hasPathLimiter])
[arguments insertObject:@"--children" atIndex:1];
NSFileHandle* handle = [repository handleForArguments: arguments];
NSTask *task = [PBEasyPipe taskForCommand:[PBGitBinary path] withArgs:arguments inDir:nil];
[task launch];
NSFileHandle* handle = [task.standardOutput fileHandleForReading];
int fd = [handle fileDescriptor];
FILE* f = fdopen(fd, "r");
@@ -153,6 +155,7 @@
// Make sure the commits are stored before exiting.
[self performSelectorOnMainThread:@selector(setCommits:) withObject:revisions waitUntilDone:YES];
[task waitUntilExit];
}
@end