From d487bccf5e5f51e5fab8c2cda92273320f730b22 Mon Sep 17 00:00:00 2001 From: Olivier Poitrey Date: Thu, 29 Nov 2012 01:32:10 +0100 Subject: [PATCH] Try to fix a random crash on dealloc --- SDWebImage/SDWebImageDownloaderOperation.m | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/SDWebImage/SDWebImageDownloaderOperation.m b/SDWebImage/SDWebImageDownloaderOperation.m index 6a158f47..d2f37327 100644 --- a/SDWebImage/SDWebImageDownloaderOperation.m +++ b/SDWebImage/SDWebImageDownloaderOperation.m @@ -112,11 +112,14 @@ - (void)reset { - self.cancelBlock = nil; - self.completedBlock = nil; - self.progressBlock = nil; - self.connection = nil; - self.imageData = nil; + dispatch_async(dispatch_get_main_queue(), ^ + { + self.cancelBlock = nil; + self.completedBlock = nil; + self.progressBlock = nil; + self.connection = nil; + self.imageData = nil; + }); } - (void)setFinished:(BOOL)finished