Przeglądaj źródła

Fix the crash when using NSCache delegate with SDMemoryCache default implementation on dealloc

DreamPiggy 6 lat temu
rodzic
commit
9b4e6286fc
1 zmienionych plików z 1 dodań i 0 usunięć
  1. 1 0
      SDWebImage/SDImageCache.m

+ 1 - 0
SDWebImage/SDImageCache.m

@@ -42,6 +42,7 @@
 
 
 - (void)dealloc {
 - (void)dealloc {
     [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
     [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
+    self.delegate = nil;
 }
 }
 
 
 - (instancetype)initWithConfig:(SDImageCacheConfig *)config {
 - (instancetype)initWithConfig:(SDImageCacheConfig *)config {