summaryrefslogtreecommitdiffstats
path: root/macosx/HBPreviewGenerator.m
diff options
context:
space:
mode:
authorritsuka <[email protected]>2013-12-03 17:01:56 +0000
committerritsuka <[email protected]>2013-12-03 17:01:56 +0000
commit037efe2d010f7983cb83879850e276af38d57a80 (patch)
treec0658d1fbebe5edb7170e72c28fa4ec73d399c74 /macosx/HBPreviewGenerator.m
parent87ba2a39cc223742796170d87a8563c2e64910d8 (diff)
MacGUI: Release the cached images when the preview window is closed.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5912 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBPreviewGenerator.m')
-rw-r--r--macosx/HBPreviewGenerator.m5
1 files changed, 3 insertions, 2 deletions
diff --git a/macosx/HBPreviewGenerator.m b/macosx/HBPreviewGenerator.m
index 99ca20f86..25a7ec344 100644
--- a/macosx/HBPreviewGenerator.m
+++ b/macosx/HBPreviewGenerator.m
@@ -52,7 +52,7 @@ typedef enum EncodeState : NSUInteger {
*
* @param index picture index in title.
*/
-- (NSImage *) imageAtIndex: (NSUInteger) index
+- (NSImage *) imageAtIndex: (NSUInteger) index shouldCache: (BOOL) cache
{
if (index >= self.imagesCount)
return nil;
@@ -67,7 +67,8 @@ typedef enum EncodeState : NSUInteger {
libhb:self.handle
title:self.title
deinterlace:self.deinterlace];
- [self.picturePreviews setObject:theImage forKey:@(index)];
+ if (cache)
+ [self.picturePreviews setObject:theImage forKey:@(index)];
}
return theImage;