-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
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
- Open the demo project
- Open the CleanWindowDemo
- Open the ContextMenu of the "Quick search" text box
- 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