Skip to content

Commit

Permalink
code review of CFRelease usage, minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean McBride authored and Sean McBride committed Jan 5, 2010
1 parent 36b7d43 commit 756b37d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions SUDiskImageUnarchiver.m
Expand Up @@ -33,9 +33,12 @@ - (void)extractDMG
if (uuid)
{
CFStringRef uuidString = CFUUIDCreateString(NULL, uuid);
if (uuidString)
{
mountPoint = [@"/Volumes" stringByAppendingPathComponent:(NSString*)uuidString];
CFRelease(uuidString);
}
CFRelease(uuid);
mountPoint = [@"/Volumes" stringByAppendingPathComponent:(NSString*)uuidString];
CFRelease(uuidString);
}
}
while (noErr == FSPathMakeRefWithOptions((UInt8 *)[mountPoint fileSystemRepresentation], kFSPathMakeRefDoNotFollowLeafSymlink, &tmpRef, NULL));
Expand Down
4 changes: 2 additions & 2 deletions SUHost.m
Expand Up @@ -108,8 +108,8 @@ - (BOOL)isBackgroundApplication
{
ProcessSerialNumber PSN;
GetCurrentProcess(&PSN);
NSDictionary * processInfo = (NSDictionary *)ProcessInformationCopyDictionary(&PSN, kProcessDictionaryIncludeAllInformationMask);
BOOL isElement = [[processInfo objectForKey:@"LSUIElement"] boolValue];
CFDictionaryRef processInfo = ProcessInformationCopyDictionary(&PSN, kProcessDictionaryIncludeAllInformationMask);
BOOL isElement = [[(NSDictionary *)processInfo objectForKey:@"LSUIElement"] boolValue];
if (processInfo)
CFRelease(processInfo);
return isElement;
Expand Down

0 comments on commit 756b37d

Please sign in to comment.