Skip to content

Commit

Permalink
Fixed leaks with NSFileManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Brittany Tarvin committed Oct 20, 2011
1 parent 613b759 commit 268ea20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SUDiskImageUnarchiver.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ - (void)extractDMG
// Now that we've mounted it, we need to copy out its contents.
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5) {
// On 10.6 and later we don't want to use the File Manager API and instead want to use NSFileManager (fixes #827357).
NSFileManager *manager = [[NSFileManager alloc] init];
NSFileManager *manager = [[[NSFileManager alloc] init] autorelease];
if (![manager copyItemAtPath:mountPoint toPath:[archivePath stringByDeletingLastPathComponent] error:NULL]) {
goto reportError;
}
Expand Down
4 changes: 2 additions & 2 deletions SUPlainInstallerInternals.m
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ + (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst temp
{
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5)
{
NSFileManager *manager = [[NSFileManager alloc] init];
NSFileManager *manager = [[[NSFileManager alloc] init] autorelease];
BOOL success = [manager moveItemAtPath:dst toPath:tmpPath error:error];
if (!success && hadFileAtDest)
{
Expand All @@ -489,7 +489,7 @@ + (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst temp
{
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5)
{
NSFileManager *manager = [[NSFileManager alloc] init];
NSFileManager *manager = [[[NSFileManager alloc] init] autorelease];
BOOL success = [manager copyItemAtPath:src toPath:dst error:error];
if (!success)
{
Expand Down

0 comments on commit 268ea20

Please sign in to comment.