Permalink
Browse files

Merge branch 'master' of git://github.com/rs/SDWebImage

  • Loading branch information...
2 parents 3d75eb3 + dd6d8db commit 99e53621a9960e1c6887f527965903bd021e46c6 @penso committed May 2, 2012
Showing with 11 additions and 1 deletion.
  1. +1 −0 SDImageCache.h
  2. +10 −1 SDImageCache.m
View
@@ -25,6 +25,7 @@
- (void)queryDiskCacheForKey:(NSString *)key delegate:(id <SDImageCacheDelegate>)delegate userInfo:(NSDictionary *)info;
- (void)removeImageForKey:(NSString *)key;
+- (void)removeImageForKey:(NSString *)key fromDisk:(BOOL)fromDisk;
- (void)clearMemory;
- (void)clearDisk;
- (void)cleanDisk;
View
@@ -298,13 +298,22 @@ - (void)queryDiskCacheForKey:(NSString *)key delegate:(id <SDImageCacheDelegate>
- (void)removeImageForKey:(NSString *)key
{
+ [self removeImageForKey:key fromDisk:YES];
+}
+
+- (void)removeImageForKey:(NSString *)key fromDisk:(BOOL)fromDisk
+{
if (key == nil)
{
return;
}
[memCache removeObjectForKey:key];
- [[NSFileManager defaultManager] removeItemAtPath:[self cachePathForKey:key] error:nil];
+
+ if (fromDisk)
+ {
+ [[NSFileManager defaultManager] removeItemAtPath:[self cachePathForKey:key] error:nil];
+ }
}
- (void)clearMemory

0 comments on commit 99e5362

Please sign in to comment.