SectionedSlider icon indicating copy to clipboard operation
SectionedSlider copied to clipboard

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

Open yonilevy opened this issue 5 years ago • 0 comments

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!

yonilevy avatar Jun 16 '20 21:06 yonilevy