From 3031c3c82419d5e8520e183d913340cc66fb03a3 Mon Sep 17 00:00:00 2001 From: Zach Waugh Date: Wed, 14 Jun 2017 18:31:02 -0400 Subject: [PATCH 1/2] Use direct ivar access to fix deadlock on accessing downloadTaskUUID --- Source/Classes/PINRemoteImageProcessorTask.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Classes/PINRemoteImageProcessorTask.m b/Source/Classes/PINRemoteImageProcessorTask.m index 9285a64a..9f4f517c 100644 --- a/Source/Classes/PINRemoteImageProcessorTask.m +++ b/Source/Classes/PINRemoteImageProcessorTask.m @@ -16,8 +16,8 @@ - (BOOL)cancelWithUUID:(NSUUID *)UUID resume:(PINResume * _Nullable * _Nullable) { BOOL noMoreCompletions = [super cancelWithUUID:UUID resume:resume]; [self.lock lockWithBlock:^{ - if (noMoreCompletions && self.downloadTaskUUID) { - [self.manager cancelTaskWithUUID:self.downloadTaskUUID]; + if (noMoreCompletions && _downloadTaskUUID) { + [self.manager cancelTaskWithUUID:_downloadTaskUUID]; _downloadTaskUUID = nil; } }]; From dceaea02a306ccf3e7835040e9811d98fb04567d Mon Sep 17 00:00:00 2001 From: Zach Waugh Date: Thu, 15 Jun 2017 13:43:06 -0400 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4bf5be3..86dc89ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## master * Add your own contributions to the next release on the line below this with your name. +- [fixed] Fixes a deadlock with canceling processor tasks [#374](https://github.com/pinterest/PINRemoteImage/pull/374) [zachwaugh](https://github.com/zachwaugh) - [fixed] Fixes a deadlock in the retry system. [garrettmoon](https://github.com/garrettmoon) - [fixed] Fixes a threadsafety issue in accessing callbacks. [garrettmoon](https://github.com/garrettmoon) - [new] PINRemoteImageManager now respects the request timout value of session configuration. [garrettmoon](https://github.com/garrettmoon)