-
Notifications
You must be signed in to change notification settings - Fork 31
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 #27
Comments
Hi! Thank you for shedding some light on this issue! I just profiled the example project on this repo and you're right, there seems to be a minor leak when the UIViewController is supposedly deallocated. I haven't analyzed it in depth yet, but it does seem to be a circular reference as you speculated! Thanks again! |
Hi! The problem is in MSCircularSlider: func initHandle() { self in closure creates retain cycle. We should use capture list here: func initHandle() { |
Hey @Vasyltm You're absolutely right! The self reference in the closure does in fact create a retain cycle. Thanks for the proposed solution as well. Will include it in the next update (and credit you in the changelog)! |
@Vasyltm Thanks so much for posting the solution - it works like a charm! |
Hi - The circular slider is amazing!
I've noticed recently it does not cleanup properly and creates memory leaks. There seems to be a circular (no pun intended) reference somewhere within the controller, therefore it is not deallocated when the containing UIViewController exits.
You can see the memory leaks if you show memory graphs when running an Xcode project in debug mode, there would be multiple instances of the circular slider created after you open and close the UIViewController multiple times.
Let me know if you need more info.
Thanks!
The text was updated successfully, but these errors were encountered: