-
Notifications
You must be signed in to change notification settings - Fork 14
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 with addChild() #6
Comments
I'm not sure I understand what you mean - can you elaborate on how adding another protocol will solve memory issues? A method would need to be called at some point - that cannot easily be done. An alternative would be to enable overriding of |
The leak in AboutCoordinator can easily be fixed by overriding the override var viewController: UIViewController! {
rootViewController.viewControllers.first { $0 is AboutViewController }
} I will open a MR today for that. |
Me too. Even build with XCoordinator v2.2.0, the child coordinator can't be removed when clicked the navigation bar back button. I have tried the way from @pauljohanneskraft , it works. |
there is a memory leak with
AboutCoordinator
- it is added as a child intoUserListCoordinator
@pauljohanneskraft we discussed this with you in slack and you adviced to
removeChild
or overrideviewController
for fix cycle.but I see a little problem, if we have a lot of coordinations in a child coordinator, override a
viewController
is not a good solution I guess.removeChild
decision isn't simple - we should notify coordinator from view (viewController) about we should free coordinator (if user tapped to back button) and handle some transitions which throw out from its coordinator. and then we should remove parent when transitions has been success.the both solutions are far from perfect, right?
I have a proposal, what do you think about
CoordinatorAutoreleasable
protocol with some method which takes some view controller notifies a main controller of this flow - like root controller, just not root. Ideally, of course, it will be perfect if we will be able to inherit some coordinator from this protocol and it will be deallocated automatically :)The text was updated successfully, but these errors were encountered: