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

Fix delegate reference cycle (memory leak) and upgrade to swift 5.0 #15

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

Conversation

yonilevy
Copy link

Hey,

I've separated the content to 4 commits:

  1. Upgrade Swift 3.0 -> 4.2
  2. Upgrade Swift 4.2 -> 5.0
  3. Change the Example project to have a navigation controller leading to the view controller, so it's easy to show the leak
  4. Fix the leak

To reproduce:

  • Go to the 3rd commit and run the example
  • Enter the slider VC, then back out, repeat a couple of times
  • Use Xcode's "Debug Memory Graph"

You'll see that there are multiple ViewControllers up, rather than one:
image

The 4th commit fixes this. More info on delegates and retains cycles here.

Hope you can approve this PR and update the Pod!

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.

None yet

1 participant