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

This commit is contained in:
Bogdan Poplauschi 2017-08-08 13:19:20 +03:00
parent 4cfb2e4b9f
commit 2f892f968f
1 changed files with 2 additions and 1 deletions

View File

@ -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;