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

Memory leak and app crash fixes #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nivanchikov
Copy link

This PR fixes a couple of issues I faced during the project onboarding

  • the app crashed when the photo library permissions were accepted since the PHPhotoLibrary callback is issued on a background thread and the app tried to run UI-related tasks from there
  • there was quite a large memory leak when the SingleImageViewController was being presented and dismissed. The leak was caused by the controller having a strong reference to a toolbar instance, and the toolbar had a strong delegate reference to the view controller thus causing a retain cycle. See the memory comparison before and after the fix below

Screen Shot 2019-10-08 at 6 28 33 AM

Screen Shot 2019-10-08 at 6 29 52 AM

@nivanchikov nivanchikov marked this pull request as ready for review October 8, 2019 03:37
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.

1 participant