Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove necessity to use view to access rangeController in ASTableNode, ASCollectionNode #1103

Merged
merged 1 commit into from
Sep 19, 2018

Conversation

maicki
Copy link
Contributor

@maicki maicki commented Sep 8, 2018

While setting the interface state of a node in certain circumstances we hit the path that first grabs the instance lock and calls -[ASCollectionNode clearContents] while the view is not loaded. Within clearContents we need access to the rangeController from the view by calling self.view.rangeController what will trigger creating the view and the assert linked in the issue will be thrown as didLoad should not be called with the instance locked held.

For now I removed the need to use the view to access the rangeController what should fix the situation described above and linked here: #1094

Further todos should be that we improve the locking impelementation around this area. Currently -[ASDisplayNode clearContents] is accessing instance variables and therefore should be prefixed with locked_, but -[ASCollectionNode clearContents] is accessing the rangeController by calling self instead of using the instance variable. The follow up issue is here: #1104

@maicki maicki force-pushed the MSAccessRangeControllerWithoutViewNeeded branch from 004e02b to 7d860d1 Compare September 12, 2018 16:40
@maicki maicki force-pushed the MSAccessRangeControllerWithoutViewNeeded branch 2 times, most recently from 6bf8ee6 to 5c983e6 Compare September 15, 2018 15:32
@TextureGroup TextureGroup deleted a comment Sep 15, 2018
@TextureGroup TextureGroup deleted a comment Sep 15, 2018
@maicki
Copy link
Contributor Author

maicki commented Sep 17, 2018

@nguyenhuy @Adlai-Holler Would appreciate a review. Thanks!

Copy link
Member

@Adlai-Holler Adlai-Holler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a jerk for delaying your review Michael.

@property (weak, nonatomic) id <ASCollectionDataSource> dataSource;
@interface _ASCollectionPendingState : NSObject {
@public
std::vector<std::vector<ASRangeTuningParameters>> _tuningParameters;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not specific to this diff, but we should probably use ASRangeTuningParameters[ASLayoutRangeModeCount][ASLayoutRangeTypeCount] _tuningParameters here so we get static allocation.

@maicki maicki force-pushed the MSAccessRangeControllerWithoutViewNeeded branch from fd7ecae to 9f605c0 Compare September 18, 2018 14:45
@maicki maicki force-pushed the MSAccessRangeControllerWithoutViewNeeded branch from 9f605c0 to f4e4475 Compare September 18, 2018 20:22
@maicki maicki merged commit cd608c9 into master Sep 19, 2018
mikezucc pushed a commit to mikezucc/Texture that referenced this pull request Oct 2, 2018
@maicki maicki deleted the MSAccessRangeControllerWithoutViewNeeded branch October 17, 2018 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants