ghost1372 / HandyControls

Contains some simple and commonly used WPF controls based on HandyControl
https://ghost1372.github.io/
MIT License
1.07k stars 102 forks source link

BomboBox ToogleBlock cause host control can't release correctly. #217

Closed levonchen closed 8 months ago

levonchen commented 8 months ago

Describe the bug

We have a project that uses handycontrol combobox to show some options. This function allows the user to open and close the window included combobox frequently. we occasionally noticed that the application will consume a large amount of system memory. So we take sometimes try to figure out this problem. we used GC collection to release objects after the user closed the windows. we noticed some other views will be released when we call GC to collect. but only one view that includes a ComboBox control will not be released. the view will only be closed when we close the application.

A workaround is I implemented my own Combobox style. the view will be released immediately when I can GC.

I used dotMemory to monitor the memory snapshot. it is very clear that the ToggleBlock used by ComboBox caused the View can't be released.

image

Steps to reproduce the bug

As described in the description field.

Expected behavior

Hope the ComboBox is released properly.

Screenshots

No response

NuGet package version

None

IDE

No response

Framework type

No response

Windows version

No response

Additional context

No response

levonchen commented 8 months ago

Upgrade to the latest version, the problem has been resolved.