Skip to content

Commit

Permalink
Avoid re-entrant call to self.view when applying initial pending state (
Browse files Browse the repository at this point in the history
TextureGroup#510)

* Avoid re-entrant call to .view

* Increment the changelog
  • Loading branch information
Adlai-Holler authored and bernieperez committed Apr 25, 2018
1 parent 28247b8 commit 11d18fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Negate iOS 11 automatic estimated table row heights. [Christian Selig](https://github.com/christianselig) [#485](https://github.com/TextureGroup/Texture/pull/485)
- Rename ASCellNode.viewModel to ASCellNode.nodeModel to reduce collisions with subclass properties implemented by clients. [Adlai Holler](https://github.com/Adlai-Holler) [#504](https://github.com/TextureGroup/Texture/pull/504)
- [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)

##2.3.5
- Fix an issue where inserting/deleting sections could lead to inconsistent supplementary element behavior. [Adlai Holler](https://github.com/Adlai-Holler)
Expand Down
5 changes: 3 additions & 2 deletions Source/ASDisplayNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3093,12 +3093,13 @@ - (void)applyPendingViewState
- (void)_locked_applyPendingViewState
{
ASDisplayNodeAssertMainThread();
ASDisplayNodeAssert([self _locked_isNodeLoaded], @"Expected node to be loaded before applying pending state.");

if (_flags.layerBacked) {
[_pendingViewState applyToLayer:self.layer];
[_pendingViewState applyToLayer:_layer];
} else {
BOOL specialPropertiesHandling = ASDisplayNodeNeedsSpecialPropertiesHandling(checkFlag(Synchronous), _flags.layerBacked);
[_pendingViewState applyToView:self.view withSpecialPropertiesHandling:specialPropertiesHandling];
[_pendingViewState applyToView:_view withSpecialPropertiesHandling:specialPropertiesHandling];
}

// _ASPendingState objects can add up very quickly when adding
Expand Down

0 comments on commit 11d18fd

Please sign in to comment.