Permalink
Browse files

Change -cgImage to -cgImageCopy to appease the Clang Static Analyzer.

  • Loading branch information...
1 parent f10bd66 commit 083842e25220bbada56f3bdf7295d05adeb63fcf @mattball committed Nov 23, 2009
Showing with 4 additions and 4 deletions.
  1. +2 −2 MBCoverFlowView.m
  2. +1 −1 NSImage+MBCoverFlowAdditions.h
  3. +1 −1 NSImage+MBCoverFlowAdditions.m
View
@@ -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"];
}
@@ -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]) {
@@ -38,6 +38,6 @@
*
* @return A CGImageRef representation for the image.
*/
-- (CGImageRef)imageRef;
+- (CGImageRef)imageRefCopy;
@end
@@ -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,

0 comments on commit 083842e

Please sign in to comment.