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 with MahApps.TextBox.ContextMenu #3989

Closed
lipchev opened this issue Dec 1, 2020 · 0 comments · Fixed by #3990
Closed

Memory Leak with MahApps.TextBox.ContextMenu #3989

lipchev opened this issue Dec 1, 2020 · 0 comments · Fixed by #3990
Labels
Milestone

Comments

@lipchev
Copy link
Contributor

lipchev commented Dec 1, 2020

Describe the bug

There is a memory leak with the default context menu (MahApps.TextBox.ContextMenu) of all text boxes (as well as the VS one).

Steps to reproduce

  1. Open the demo project
  2. Open the CleanWindowDemo
  3. Open the ContextMenu of the "Quick search" text box
  4. Close the window

Expected behavior

When the parent is unloaded the memory is liberated

Actual behavior

The CleanWindowDemo window is retained in memory via the ContextMenu (see screenshot below)
Setting the MahApps.TextBox.ContextMenu as x:Shared="False" fixes the issue (PR coming)

PS. It's funny how I didn't notice it the last time- but then I must have only profiled the context menu of the "seek bar" and the DropShadowEffect of the text box, but not the context menu of the text box.

Environment

MahApps.Metro version: v2.4.0
Windows build number: Win10 
Visual Studio: 2019 16.8
Target Framework: .Net v4.7.2

Screenshots

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants