Skip to content

Commit

Permalink
Fixed a no-autorelease-pool leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
andymatuschak committed Oct 10, 2011
1 parent 01e8cf9 commit 95398cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions SUPipedUnarchiver.m
Expand Up @@ -48,11 +48,12 @@ - (void)extractArchivePipingDataToCommand:(NSString *)command
{
// *** GETS CALLED ON NON-MAIN THREAD!!!

SULog(@"Extracting %@ using '%@'",archivePath,command);

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
FILE *fp = NULL, *cmdFP = NULL;

SULog(@"Extracting %@ using '%@'",archivePath,command);

// Get the file size.
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
NSNumber *fs = [[[NSFileManager defaultManager] fileAttributesAtPath:archivePath traverseLink:NO] objectForKey:NSFileSize];
Expand Down Expand Up @@ -98,7 +99,7 @@ - (void)extractArchivePipingDataToCommand:(NSString *)command
finally:
if (fp)
fclose(fp);
[pool drain];
[pool release];
}

- (void)extractTAR
Expand Down

0 comments on commit 95398cd

Please sign in to comment.