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 nesting ViewModelViewHosts in WPF #1314

Closed
kentcb opened this issue Mar 8, 2017 · 4 comments
Closed

Memory leak when nesting ViewModelViewHosts in WPF #1314

kentcb opened this issue Mar 8, 2017 · 4 comments

Comments

@kentcb
Copy link
Contributor

kentcb commented Mar 8, 2017

Do you want to request a feature or report a bug?

Bug.

What is the current behavior?

Memory leaks when nesting ViewModelViewHost instances. It seems the DependencyProperty infrastructure is holding onto an instance of the ViewModelViewHost, which in turn has a reference to a VM:

image

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

The best repro I have is the source code for my book samples, which is not currently publicly available. If someone wants to take a look at this before I do then ping me.

What is the expected behavior?

Memory should not leak, regardless of how nested ViewModelViewHost instances are.

What is the motivation / use case for changing the behavior?

Leaking memory is bad, mkay?

Which versions of ReactiveUI, and which platform / OS are affected by this issue? Did this work in previous versions of ReativeUI? Please also test with the latest stable and snapshot (http://docs.reactiveui.net/en/contributing/snapshot/index.html) versions.

7.2

Other information (e.g. stacktraces, related issues, suggestions how to fix)

@stale
Copy link

stale bot commented Aug 25, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this because it helps reduce the workload of our extremely busy maintainers. If you want this issue progressed faster please start talks with a maintainer with how you can help out.
There are so many ways to contribute to open-source and the most valued are often not code related. We are always looking for more help and look after those who stick around. Say howdy to one of the maintainers or browse https://reactiveui.net/contribute/ for ideas on where to start your journey.

@offan
Copy link

offan commented Mar 12, 2018

  1. Why reverse navigation creates a new copy of the view that is in the ViewModelViewHost?
  2. If the ViewModelViewHost has set the visibility property Collapsed and reverse navigation (HostScreen.Router.NavigateBack.Execute(new System.Reactive.Unit());) have a memory leak. because of (fe.WhenAnyValue(x => x.IsHitTestVisible).SkipWhile(x => !x)) not dispose.

@ChrisPulman
Copy link
Member

Should be fixed via #3105

Bug Stomping automation moved this from To do to Done Dec 12, 2021
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Bug Stomping
  
Done
Development

No branches or pull requests

5 participants