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 in ReplaySubject, WithLatestFrom, and anything else that uses the DemandBuffer #139

Closed
adlerj opened this issue Aug 3, 2022 · 1 comment · Fixed by #140
Closed

Comments

@adlerj
Copy link

adlerj commented Aug 3, 2022

Repro Video
Sample Project

This project is setup with ViewController -> ChildViewController -> GrandChildViewController

The leak occurs only when ChildViewController sinks to the postsSubject

It seems that if a publisher is bound somewhere else, and then that same publisher is used with a withLatestFrom a retain cycle is introduced and Combine internally crashes

Seems like the DemandBuffer doesn't correctly forward completion information upstream if the upstream Subscriber is being used somewhere else which is why we are crashing in WithLatestFrom and share(replay: 1)

@adlerj
Copy link
Author

adlerj commented Aug 3, 2022

I think this might be related #114

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

Successfully merging a pull request may close this issue.

1 participant