Skip to content

Commit e1c7801

Browse files
christophpurrerappden
authored andcommitted
Fix RCTImageCache on macOS (microsoft#1272)
The cache's `totalCostLimit` and the `_cacheStaleTimes` ivar were not getting set for Mac, presumably due to a merge mistake. I'm not sure what (if any) positive impact this will realistically have on memory consumption. Tested rn-tester scrolling through several threads with lots of images. Everything works well. Co-authored-by: Scott Kyle <skyle@fb.com>
1 parent 61d9a1f commit e1c7801

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Libraries/Image/RCTImageCache.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ - (instancetype)init
3838
{
3939
if (self = [super init]) {
4040
_decodedImageCache = [NSCache new];
41-
#if !TARGET_OS_OSX // TODO(macOS GH#774)
4241
_decodedImageCache.totalCostLimit = 20 * 1024 * 1024; // 20 MB
4342
_cacheStaleTimes = [NSMutableDictionary new];
4443

44+
#if !TARGET_OS_OSX // TODO(macOS GH#774)
4545
[[NSNotificationCenter defaultCenter] addObserver:self
4646
selector:@selector(clearCache)
4747
name:UIApplicationDidReceiveMemoryWarningNotification

0 commit comments

Comments
 (0)