Possible memory leak when reloading images in MarkdownTextBlock
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- csharp
- 领域
- desktop-dev
调研方向
从 issue 中描述的 MarkdownTextBlock Init() 和 LoadImage handler 路径开始,重点关注通过 IImageProvider 替换 _image 实例。建立一个可复现的图像重新加载案例,然后使用适当的泄漏检查验证替换图像不会保留过时的 Loaded handler 或对象。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
Found by Copilot in https://github.com/CommunityToolkit/Labs-Windows/pull/771/
When using IImageProvider, the _image instance is replaced with a new Image object from the provider. This means the Loaded event handler attached in Init() is lost, since it was attached to the original _image instance. However, since this code is already executing within the LoadImage handler and _loaded is set to true immediately after, this might work correctly. Consider whether the event handler should be detached from the old image or if there's a risk of memory leaks from the orphaned handler on the original image object.
Steps to reproduce
Unknown, need investigation.
Expected behavior
No memory leaks when images are changed.
Screenshots
No response
Code Platform
- UWP
- WinAppSDK / WinUI 3
- Web Assembly (WASM)
- Android
- iOS
- MacOS
- Linux / GTK
Windows Build Number
- Windows 10 1809 (Build 17763)
- Windows 10 1903 (Build 18362)
- Windows 10 1909 (Build 18363)
- Windows 10 2004 (Build 19041)
- Windows 10 20H2 (Build 19042)
- Windows 10 21H1 (Build 19043)
- Windows 11 21H2 (Build 22000)
- Other (specify)
Other Windows Build number
No response
App minimum and target SDK version
- Windows 10, version 1809 (Build 17763)
- Windows 10, version 1903 (Build 18362)
- Windows 10, version 1909 (Build 18363)
- Windows 10, version 2004 (Build 19041)
- Other (specify)
Other SDK version
No response
Visual Studio Version
No response
Visual Studio Build Number
No response
Device form factor
No response
Additional context
No response
Help us help you
Yes, I'd like to be assigned to work on this item.
- 主要语言
- C#
- 星标
- 483
- 派生
- 89
- 平均合并
- 4 天 5 小时
- 30 天内合并 PR
- 2
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CommunityToolkit/Labs-Windows 的其他 Issue
-
bug :bug:
难度 1/5 1-3 小时 新手友好度 80/100
CommunityToolkit/Labs-Windows#815 ·
-
bug :bug:
难度 4/5 3-5 天 新手友好度 38/100
CommunityToolkit/Labs-Windows#816 ·
-
bug :bug:
难度 3/5 1-2 天 新手友好度 55/100
CommunityToolkit/Labs-Windows#814 ·
-
experiment :test_tube:
难度 4/5 3-5 天 新手友好度 48/100
CommunityToolkit/Labs-Windows#812 ·
-
ux :paintbrush:
难度 3/5 1-2 天 新手友好度 52/100
CommunityToolkit/Labs-Windows#808 · 1 条评论 ·
查看 CommunityToolkit/Labs-Windows 的全部 Issue
相似的 Issue
-
bug component/other
难度 2/5 1-3 小时 新手友好度 73/100
umbraco/Umbraco.AI#511 ·
维护者通常 1 天内回复
-
sev:L
难度 1/5 1 小时以内 新手友好度 72/100
Systemorph/MeshWeaver#6233 ·
维护者通常 1 天内回复
-
[Bug]:未关闭bug needs response
难度 2/5 1-3 小时 新手友好度 66/100
Adyen/adyen-dotnet-api-library#1874 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
CommunityToolkit/Aspire#2231 ·
维护者通常 1 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 90/100
Flow-Launcher/Flow.Launcher#4697 ·
维护者通常 4 天内回复