瀏覽代碼

Attempt to fix #1883 by using a weakSelf reference to remove from callbackBlocks (on the barrierQueue)

Bogdan Poplauschi 8 年之前
父節點
當前提交
2f892f9
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      SDWebImage/SDWebImageDownloaderOperation.m

+ 2 - 1
SDWebImage/SDWebImageDownloaderOperation.m

@@ -223,8 +223,9 @@ typedef NSMutableDictionary<NSString *, id> SDCallbacksDictionary;
 }
 
 - (void)reset {
+    __weak typeof(self) weakSelf = self;
     dispatch_barrier_async(self.barrierQueue, ^{
-        [self.callbackBlocks removeAllObjects];
+        [weakSelf.callbackBlocks removeAllObjects];
     });
     self.dataTask = nil;
     self.imageData = nil;