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

ToggleBlock 内存泄露 #1461

Closed
cuiliang opened this issue Sep 6, 2023 · 4 comments
Closed

ToggleBlock 内存泄露 #1461

cuiliang opened this issue Sep 6, 2023 · 4 comments

Comments

@cuiliang
Copy link
Contributor

cuiliang commented Sep 6, 2023

Describe the bug

发现ToggleBlock会导致内存泄露。

image

尝试Demo,也有类似问题:

image

Steps to reproduce the bug

启动Demo,使用DotMemory多次快照并对比。

Expected behavior

No response

Screenshots

No response

NuGet package version

None

IDE

Visual Studio 2022

Framework type

.Net Framework 4.8, .Net Framework 4.7.2

Windows version

No response

Additional context

No response

@cuiliang
Copy link
Contributor Author

cuiliang commented Sep 6, 2023

这样似乎可以解决,供大佬参考。
81289ab56d50bce4a6454405e22e24c6

@cuiliang
Copy link
Contributor Author

另外,可能是因为使用MouseGesture的原因,有时候点击ComboBox不会展开下拉框。
我目前的处理方法是在OnToggleGestureChanged里写一个是否需要触发下拉的标记,然后继承OnMouseLeftButtonDown方法,在这个标记启用的时候切换IsChecked。

https://github.com/cuiliang/HandyControl/blob/master/src/Shared/HandyControl_Shared/Controls/Block/ToggleBlock.cs#L76

@NaBian NaBian closed this as completed in 8e1e826 Sep 26, 2023
@GF-Huang
Copy link
Member

@NaBian commit 8e1e826 疑似产生了这个问题:ghost1372/HandyControls#213

@DineshSolanki
Copy link

DineshSolanki commented Dec 8, 2023

In addition, maybe because of the use of MouseGesture, sometimes clicking the ComboBox will not expand the drop-down box. My current method is to write a tag in OnToggleGestureChanged to determine whether the drop-down needs to be triggered, and then inherit the OnMouseLeftButtonDown method to switch IsChecked when the tag is enabled.

cuiliang/HandyControl@ master/src/Shared/HandyControl_Shared/Controls/Block/ToggleBlock.cs#L76

this happens, with the combobox dropdown auto closes and only is open until I don't lift mouse button,

#1467

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

No branches or pull requests

3 participants