From bdef7651f02e3e725a46b1d30045d0ebf96ef4a3 Mon Sep 17 00:00:00 2001 From: Jonas Salling Date: Tue, 22 Apr 2014 14:52:20 +0200 Subject: [PATCH] Update SDWebImageDownloaderOperation.m Fixing race condition that causes cancellation of one download operation to stop a run loop that is now used for another download operation. Race is introduced through -performSelector:onThread:withObject:waitUntilDone: --- SDWebImage/SDWebImageDownloaderOperation.m | 1 + 1 file changed, 1 insertion(+) diff --git a/SDWebImage/SDWebImageDownloaderOperation.m b/SDWebImage/SDWebImageDownloaderOperation.m index 05783f8..baced7c 100644 --- a/SDWebImage/SDWebImageDownloaderOperation.m +++ b/SDWebImage/SDWebImageDownloaderOperation.m @@ -129,6 +129,7 @@ } - (void)cancelInternalAndStop { + if (self.isFinished) return; [self cancelInternal]; CFRunLoopStop(CFRunLoopGetCurrent()); }