Fix double call to NSURLConnection start + wrong condition for low priority (fix #212)
This commit is contained in:
parent
ed690465d8
commit
bf1b946b9a
|
@ -56,16 +56,15 @@
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^
|
dispatch_async(dispatch_get_main_queue(), ^
|
||||||
{
|
{
|
||||||
self.connection = [NSURLConnection.alloc initWithRequest:self.request delegate:self startImmediately:NO];
|
|
||||||
[self.connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
|
|
||||||
[self.connection start];
|
|
||||||
self.executing = YES;
|
self.executing = YES;
|
||||||
|
self.connection = [NSURLConnection.alloc initWithRequest:self.request delegate:self startImmediately:NO];
|
||||||
|
|
||||||
// If not in low priority mode, ensure we aren't blocked by UI manipulations (default runloop mode for NSURLConnection is NSEventTrackingRunLoopMode)
|
// If not in low priority mode, ensure we aren't blocked by UI manipulations (default runloop mode for NSURLConnection is NSEventTrackingRunLoopMode)
|
||||||
if (self.options & SDWebImageDownloaderLowPriority)
|
if (!(self.options & SDWebImageDownloaderLowPriority))
|
||||||
{
|
{
|
||||||
[self.connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
|
[self.connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
|
||||||
}
|
}
|
||||||
|
|
||||||
[self.connection start];
|
[self.connection start];
|
||||||
|
|
||||||
if (self.connection)
|
if (self.connection)
|
||||||
|
|
Loading…
Reference in New Issue