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

Only clear ASCollectionView's data during deallocation #1154

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
- Optimize layout process by removing `ASRectMap`. [Adlai Holler](https://github.com/Adlai-Holler)
- Remove necessity to use view to access rangeController in ASTableNode, ASCollectionNode. [Michael Schneider](https://github.com/maicki)
- Remove display node's reliance on shared_ptr. [Adlai Holler](https://github.com/Adlai-Holler)
- [ASCollectionView] Fix a crash that is caused by clearing a collection view's data while it's still being used. [Huy Nguyen](https://github.com/nguyenhuy) [#1154](https://github.com/TextureGroup/Texture/pull/1154)
- Clean up timing of layout tree flattening/ copying of unflattened tree for Weaver. [Michael Zuccarino](https://github.com/mikezucc) [#1157](https://github.com/TextureGroup/Texture/pull/1157)

## 2.7
Expand Down
3 changes: 2 additions & 1 deletion Schemas/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"exp_network_image_queue",
"exp_dealloc_queue_v2",
"exp_collection_teardown",
"exp_framesetter_cache"
"exp_framesetter_cache",
"exp_clear_data_during_deallocation"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/ASCollectionView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ - (void)_asyncDelegateOrDataSourceDidChange
{
ASDisplayNodeAssertMainThread();

if (_asyncDataSource == nil && _asyncDelegate == nil && !ASActivateExperimentalFeature(ASExperimentalSkipClearData)) {
if (_asyncDataSource == nil && _asyncDelegate == nil && _isDeallocating && ASActivateExperimentalFeature(ASExperimentalClearDataDuringDeallocation)) {
[_dataController clearData];
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/ASExperimentalFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ typedef NS_OPTIONS(NSUInteger, ASExperimentalFeatures) {
ASExperimentalNetworkImageQueue = 1 << 5, // exp_network_image_queue
ASExperimentalCollectionTeardown = 1 << 6, // exp_collection_teardown
ASExperimentalFramesetterCache = 1 << 7, // exp_framesetter_cache
ASExperimentalSkipClearData = 1 << 8, // exp_skip_clear_data
ASExperimentalClearDataDuringDeallocation = 1 << 8, // exp_clear_data_during_deallocation
ASExperimentalFeatureAll = 0xFFFFFFFF
};

Expand Down
2 changes: 1 addition & 1 deletion Source/ASExperimentalFeatures.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@"exp_dealloc_queue_v2",
@"exp_collection_teardown",
@"exp_framesetter_cache",
@"exp_skip_clear_data"]));
@"exp_clear_data_during_deallocation"]));

if (flags == ASExperimentalFeatureAll) {
return allNames;
Expand Down