-
Notifications
You must be signed in to change notification settings - Fork 13
Memory Leak when subclassing CombineExtensionsProvider #78
Description
ℹ Please fill out this template when filing an issue.
All lines beginning with an ℹ symbol instruct you with what info we expect. You can delete those lines once you've filled in the info.Please remove this line and everything above it before submitting.
- I've read, understood, and done my best to follow the *CONTRIBUTING guidelines.
What did you do?
On immi we have class HomeViewController: UIViewController that also conforms to CombineExtensionsProvider. We also subclass this for different devices by declaring final class PhoneHomeViewController: HomeViewController.
The issue is when using the performForLifetimeOf(self) Combine modifier, there appears to be a memory leak due to the binding being stored in multiple instances of cancellables
What did you expect to happen?
When subclassing with a CombineExtensionsProvider, I would expect all bindings to be released when self is deinitialized.
What happened instead?
Instead, bindings are causing a retain cycle presumably because they are stored in multiple places (the subclassed cancellables and the super-class cancellables)
Environment
FueledUtils version:
Xcode version:
Swift version:
Platform(s):
macOS version running Xcode:
Demo Project
Several PRs in immi have addressed this issue in various forms:
- An action buttons PR.
- UI Fixes in PR 777
- Constraint issues in PR 772
- Another issue raised in PR 767 about assign(.., forLifetimeOf: self) (a related extension)