From 13e9106ead51cb94b81c0a4e27b617ecec27a5f3 Mon Sep 17 00:00:00 2001 From: Greg Bolsinga Date: Fri, 6 Sep 2019 12:17:00 -0700 Subject: [PATCH] lock to access the image renderingMode Missing with #1629 --- Source/ASImageNode.mm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/ASImageNode.mm b/Source/ASImageNode.mm index 05d1e3ac1..7b8aba99d 100644 --- a/Source/ASImageNode.mm +++ b/Source/ASImageNode.mm @@ -610,7 +610,14 @@ - (void)setNeedsDisplayWithCompletion:(void (^ _Nullable)(BOOL canceled))display - (void)tintColorDidChange { [super tintColorDidChange]; - if (_image.renderingMode == UIImageRenderingModeAlwaysTemplate) { + + BOOL isTemplateImage = NO; + { + AS::MutexLocker l(__instanceLock__); + isTemplateImage = (_image.renderingMode == UIImageRenderingModeAlwaysTemplate); + } + + if (isTemplateImage) { [self setNeedsDisplay]; } }