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

Memory Leak when subclassing CombineExtensionsProvider #78

Open
1 task done
robdeans opened this issue Dec 8, 2022 · 0 comments
Open
1 task done

Memory Leak when subclassing CombineExtensionsProvider #78

robdeans opened this issue Dec 8, 2022 · 0 comments

Comments

@robdeans
Copy link

robdeans commented Dec 8, 2022

ℹ 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.

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:

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

1 participant