Skip to content

Commit

Permalink
Cover the other background dealloc surfaces (TextureGroup#1464)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikezucc authored and hebertialmeida committed May 10, 2019
1 parent 1a7fdb8 commit 7757a60
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/ASImageNode+AnimatedImage.mm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ - (void)_locked_setAnimatedImage:(id <ASAnimatedImageProtocol>)animatedImage
[self animatedImageSet:animatedImage previousAnimatedImage:previousAnimatedImage];

// Animated image can take while to dealloc, do it off the main queue
if (previousAnimatedImage != nil) {
if (previousAnimatedImage != nil && ASActivateExperimentalFeature(ASExperimentalOOMBackgroundDeallocDisable) == NO) {
ASPerformBackgroundDeallocation(&previousAnimatedImage);
}
});
Expand Down
2 changes: 1 addition & 1 deletion Source/ASImageNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ - (void)_locked_setImage:(UIImage *)image
CGSize oldImageSize = oldImage.size;
BOOL shouldReleaseImageOnBackgroundThread = oldImageSize.width > kMinReleaseImageOnBackgroundSize.width
|| oldImageSize.height > kMinReleaseImageOnBackgroundSize.height;
if (shouldReleaseImageOnBackgroundThread) {
if (shouldReleaseImageOnBackgroundThread && ASActivateExperimentalFeature(ASExperimentalOOMBackgroundDeallocDisable) == NO) {
ASPerformBackgroundDeallocation(&oldImage);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/ASMultiplexImageNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ - (void)_clearImage
BOOL shouldReleaseImageOnBackgroundThread = imageSize.width > kMinReleaseImageOnBackgroundSize.width ||
imageSize.height > kMinReleaseImageOnBackgroundSize.height;
[self _setImage:nil];
if (shouldReleaseImageOnBackgroundThread) {
if (shouldReleaseImageOnBackgroundThread && ASActivateExperimentalFeature(ASExperimentalOOMBackgroundDeallocDisable) == NO) {
ASPerformBackgroundDeallocation(&image);
}
}
Expand Down

0 comments on commit 7757a60

Please sign in to comment.