antvis/G6


Do you want to work on this issue?
You can request for a bounty in order to promote it!
[Bug]: the upsert method in base-shape.js may cause memory leak #6850
ZTao-z posted onGitHub
Describe the bug / 问题描述
base-shape.ts中的upsert函数只关心新增或已存在的shape,如果渲染过程中shape的key值发生变化,已存在于 shapeMap 上的元素无法被清空
Reproduction link / 复现链接
No response
Steps to Reproduce the Bug or Issue / 重现步骤
render() {
upsert(`key-${Math.random()}`, ..., ...)
}
当每次渲染的shape的className不是相同的,上次渲染的shape就会常驻在shapeMap中,无法被删除和更新
Version / 版本
🆕 5.x
OS / 操作系统
- macOS
- Windows
- Linux
- Others / 其他
Browser / 浏览器
- Chrome
- Edge
- Firefox
- Safari (Limited support / 有限支持)
- IE (Nonsupport / 不支持)
- Others / 其他