Attempt to fix #1883 by using a weakSelf reference to remove from callbackBlocks…
… (on the barrierQueue)
Showing
1 changed file
with
2 additions
and
1 deletions
@@ -223,8 +223,9 @@ typedef NSMutableDictionary<NSString *, id> SDCallbacksDictionary; | @@ -223,8 +223,9 @@ typedef NSMutableDictionary<NSString *, id> SDCallbacksDictionary; | ||
223 | } | 223 | } |
224 | 224 | ||
225 | - (void)reset { | 225 | - (void)reset { |
226 | + __weak typeof(self) weakSelf = self; | ||
226 | dispatch_barrier_async(self.barrierQueue, ^{ | 227 | dispatch_barrier_async(self.barrierQueue, ^{ |
227 | - [self.callbackBlocks removeAllObjects]; | 228 | + [weakSelf.callbackBlocks removeAllObjects]; |
228 | }); | 229 | }); |
229 | self.dataTask = nil; | 230 | self.dataTask = nil; |
230 | self.imageData = nil; | 231 | self.imageData = nil; |
-
Please register or login to post a comment