Explorar o código

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

Bogdan Poplauschi %!s(int64=8) %!d(string=hai) anos
pai
achega
2f892f9
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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;