Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions AsyncDisplayKit/ASImageNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,11 @@ - (UIImage *)displayWithParameters:(id<NSObject> *)parameter isCancelled:(asdisp
if (entry == nil) { // If nil, we were cancelled.
return nil;
}
_weakCacheEntry = entry; // Retain so that the entry remains in the weak cache

__instanceLock__.lock();
_weakCacheEntry = entry; // Retain so that the entry remains in the weak cache
__instanceLock__.unlock();

return entry.value;
}

Expand Down Expand Up @@ -523,9 +527,11 @@ - (void)setNeedsDisplayWithCompletion:(void (^ _Nullable)(BOOL canceled))display

- (void)clearContents
{
[super clearContents];
[super clearContents];

__instanceLock__.lock();
_weakCacheEntry = nil; // release contents from the cache.
__instanceLock__.unlock();
}

#pragma mark - Cropping
Expand Down