From 359b5f0b5bece3f41fcc6e1a1da1f1cbf510f626 Mon Sep 17 00:00:00 2001 From: Phil Larson Date: Mon, 21 Aug 2017 04:49:11 -0700 Subject: [PATCH] ASImageNode+AnimatedImage playbackReadyCallback retain cycle (#520) * ASImageNode+AnimatedImage playbackReadyCallback causes strong retain cycle * Add CHANGELOG entry for #520 --- CHANGELOG.md | 1 + Source/ASImageNode+AnimatedImage.mm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8302e826..456567919 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - [Breaking] Add content offset bridging property to ASTableNode and ASCollectionNode. Deprecate related methods in ASTableView and ASCollectionView [Huy Nguyen](https://github.com/nguyenhuy) [#460](https://github.com/TextureGroup/Texture/pull/460) - Remove re-entrant access to self.view when applying initial pending state. [Adlai Holler](https://github.com/Adlai-Holler) [#510](https://github.com/TextureGroup/Texture/pull/510) - Small improvements in ASCollectionLayout [Huy Nguyen](https://github.com/nguyenhuy) [#509](https://github.com/TextureGroup/Texture/pull/509) [#513](https://github.com/TextureGroup/Texture/pull/513) +- Fix retain cycle between ASImageNode and PINAnimatedImage [Phil Larson](https://github.com/plarson) [#520](https://github.com/TextureGroup/Texture/pull/520) ##2.4 - Fix an issue where inserting/deleting sections could lead to inconsistent supplementary element behavior. [Adlai Holler](https://github.com/Adlai-Holler) diff --git a/Source/ASImageNode+AnimatedImage.mm b/Source/ASImageNode+AnimatedImage.mm index 0ff21c4b4..0d12351dd 100644 --- a/Source/ASImageNode+AnimatedImage.mm +++ b/Source/ASImageNode+AnimatedImage.mm @@ -70,7 +70,7 @@ - (void)_locked_setAnimatedImage:(id )animatedImage } else { animatedImage.playbackReadyCallback = ^{ // In this case the lock is already gone we have to call the unlocked version therefore - [self setShouldAnimate:YES]; + [weakSelf setShouldAnimate:YES]; }; } }