From 8f2cc570f5a3c8f0fe3078e36d58f1f9e8be3ee1 Mon Sep 17 00:00:00 2001 From: Bryce Kerley Date: Mon, 17 Nov 2008 14:49:45 -0500 Subject: [PATCH] Use a task (that is properly disposed of) for reading the rev list --- PBGitRevList.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PBGitRevList.m b/PBGitRevList.m index 0f1a969..8bd1fcf 100644 --- a/PBGitRevList.m +++ b/PBGitRevList.m @@ -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