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

Possible retain cycle found in the example project and my own code #27

Open
Jackson0111 opened this issue Jun 24, 2016 · 4 comments
Open

Comments

@Jackson0111
Copy link

Hi there! I have been using this library for a while now, great work, really appreciate it! I was debugging my own project (which installed elastic transition) for some memory issues. I think I ended up discovering some strange behavior in elastic transition. The deinit function was never called in my view controller, so I commented out all code trying to figure out where the retain cycle was. Finally I found out the transition function was the one that actually caused this in the parent view controller. I then ran the example project using instruments. Here is what I found:

screen shot 2016-06-24 at 7 44 37 pm

I also added deinit function to print something in the options view controller, but it was never printed until the second time the view controller is presented. I'm fairly sure there is a retain cycle somewhere. I then checked ElasticMenuTransitionDelegate trying to see if anything would have a strong reference to the view controller, but no luck there. Please take a look and let me know what you think. Thanks!

@Jackson0111
Copy link
Author

screen shot 2016-06-24 at 8 03 49 pm

this might be the problem since it doesn't seem to be released.

@mohamedghonemi
Copy link

In case of any one still interested in this issue, I solved this issue by changing EdgePanTransition.swift by adding weak attribute to transitionContext property. so it becomes

weak var transitionContext:UIViewControllerContextTransitioning!

@phuhk
Copy link

phuhk commented May 26, 2019

actually, just need assign transitionContext to nil when you have done :)
In my case is when reset rootNavigation and use ElasticTransition for left side menu.

@junestchick
Copy link

Hi @phuhk, cái VC t thừa kế từ cái ElasticVC nó k deinit được, k biết bạn có bị z không? Đã thử những cách trên nhưng cũng k được :((

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

No branches or pull requests

4 participants