From 5cc5abae03f30bc34abd4f095b7093f333cdf726 Mon Sep 17 00:00:00 2001 From: iOSPandaLee Date: Thu, 5 May 2016 11:51:19 +0800 Subject: [PATCH] Repair memory release in the iPad environment In the iPad environment, NSCache lead to anonymous VM very high, if reaches a certain value, app will be crash. Because of SDImageCache don't clear memory when receive memory warning notification, modify define TARGET_OS_IPHONE to TARGET_OS_IOS can resolve this issue. --- SDWebImage/SDImageCache.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDWebImage/SDImageCache.m b/SDWebImage/SDImageCache.m index aa0ff6c9..4d6afb43 100644 --- a/SDWebImage/SDImageCache.m +++ b/SDWebImage/SDImageCache.m @@ -126,7 +126,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { _fileManager = [NSFileManager new]; }); -#if TARGET_OS_IPHONE +#if TARGET_OS_IOS // Subscribe to app events [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clearMemory)