Skip to content

Commit

Permalink
Change -cgImage to -cgImageCopy to appease the Clang Static Analyzer.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattball committed Nov 23, 2009
1 parent f10bd66 commit 083842e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions MBCoverFlowView.m
Expand Up @@ -769,7 +769,7 @@ - (void)_loadImageForLayer:(CALayer *)layer
imageRef = CGImageRetain(_placeholderRef);
[layer setValue:[NSNumber numberWithBool:NO] forKey:@"hasImage"];
} else {
imageRef = [image imageRef];
imageRef = [image imageRefCopy];
[layer setValue:[NSNumber numberWithBool:YES] forKey:@"hasImage"];
}

Expand Down Expand Up @@ -852,7 +852,7 @@ - (void)_recachePlaceholder

[placeholder unlockFocus];

_placeholderRef = [placeholder imageRef];
_placeholderRef = [placeholder imageRefCopy];

// Update the placeholder for all necessary items
for (CALayer *layer in [_scrollLayer sublayers]) {
Expand Down
2 changes: 1 addition & 1 deletion NSImage+MBCoverFlowAdditions.h
Expand Up @@ -38,6 +38,6 @@
*
* @return A CGImageRef representation for the image.
*/
- (CGImageRef)imageRef;
- (CGImageRef)imageRefCopy;

@end
2 changes: 1 addition & 1 deletion NSImage+MBCoverFlowAdditions.m
Expand Up @@ -29,7 +29,7 @@ of this software and associated documentation files (the "Software"), to deal

@implementation NSImage (MBCoverFlowAdditions)

- (CGImageRef)imageRef
- (CGImageRef)imageRefCopy
{
CGContextRef context = CGBitmapContextCreate(NULL/*data - pass NULL to let CG allocate the memory*/,
[self size].width,
Expand Down

0 comments on commit 083842e

Please sign in to comment.