Permalink
Browse files

Static analyzer caught a potential over-release here.

  • Loading branch information...
1 parent a39c61c commit e07f5d9c2c17da041d3e46792c123e2b6d79019f @boredzo committed Sep 29, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 QLDataURL/PRHThumbnailsWindowController.m
@@ -61,12 +61,13 @@ - (void)windowDidLoad {
QLThumbnailRef thumbnailAttempt = QLThumbnailCreate(kCFAllocatorDefault, (__bridge CFURLRef)self.imageDataURL, self.imageSize, (__bridge CFDictionaryRef)options);
if (thumbnailAttempt) {
thumbnailCGImage = QLThumbnailCopyImage(thumbnailAttempt);
+ if (thumbnailCGImage) {
+ self.dispatchObtainedThumbnailImage = [[NSImage alloc] initWithCGImage:thumbnailCGImage size:self.imageSize];
+ CFRelease(thumbnailCGImage);
+ }
+
CFRelease(thumbnailAttempt);
}
- if (thumbnailCGImage) {
- self.dispatchObtainedThumbnailImage = [[NSImage alloc] initWithCGImage:thumbnailCGImage size:self.imageSize];
- CFRelease(thumbnailCGImage);
- }
thumbnailAttempt = QLThumbnailCreate(kCFAllocatorDefault, (__bridge CFURLRef)self.imageDataURL, self.imageSize, (__bridge CFDictionaryRef)options);
if (thumbnailAttempt) {

0 comments on commit e07f5d9

Please sign in to comment.