Merge pull request #28 from wildchocolate/master

Fixed leaks with NSFileManager
This commit is contained in:
Andy Matuschak committed 2011-10-20 08:05:26 -07:00
commit 5dce90eafa
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -67,7 +67,7 @@
// 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;
}
+2 -2
View File
@@ -464,7 +464,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
{
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)
{
@@ -489,7 +489,7 @@ static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authoriza
{
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)
{