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.
Showing
1 changed file
with
1 additions
and
1 deletions
@@ -126,7 +126,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { | @@ -126,7 +126,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { | ||
126 | _fileManager = [NSFileManager new]; | 126 | _fileManager = [NSFileManager new]; |
127 | }); | 127 | }); |
128 | 128 | ||
129 | -#if TARGET_OS_IPHONE | 129 | +#if TARGET_OS_IOS |
130 | // Subscribe to app events | 130 | // Subscribe to app events |
131 | [[NSNotificationCenter defaultCenter] addObserver:self | 131 | [[NSNotificationCenter defaultCenter] addObserver:self |
132 | selector:@selector(clearMemory) | 132 | selector:@selector(clearMemory) |
-
Please register or login to post a comment