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

Don't pass reference of batchOperation to closure to restore behavior before c7c79c7 #116

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

HeEAaD
Copy link
Contributor

@HeEAaD HeEAaD commented Apr 24, 2024

c7c79c7 introduced a regression:
The completion closure of UICollectionView.performBatchUpdates(_:completion:) has a strong reference to batchOperation. This causes that the batchOperation stays longer in memory as the collection view itself.

A symptom of this is that MainCollectionViewContext.apply(update:) might get called while the adapter is deallocated already.

This PR restores behavior to the state before c7c79c7 by just referencing the completion closure instead of batchOperation.

@HeEAaD HeEAaD changed the title Don't pass reference of batchOperation to closure to restore behavior before c7c79c7808037ec56555e59a373f9339e634457c Don't pass reference of batchOperation to closure to restore behavior before c7c79c7 Apr 24, 2024
Copy link
Contributor

@CalvinChangCC CalvinChangCC left a comment

Choose a reason for hiding this comment

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

Thanks for fixing it!

@HeEAaD HeEAaD force-pushed the revert_c7c79c7808037ec56555e59a373f9339e634457c branch from 30b1307 to 8a75feb Compare April 25, 2024 08:48
@HeEAaD HeEAaD force-pushed the revert_c7c79c7808037ec56555e59a373f9339e634457c branch from 8a75feb to 0002569 Compare April 25, 2024 08:50
@HeEAaD HeEAaD merged commit a59e6bf into develop Apr 25, 2024
1 check passed
@HeEAaD HeEAaD deleted the revert_c7c79c7808037ec56555e59a373f9339e634457c branch April 25, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants