We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我在做我们产品的内存快照分析时发现了这个问题: 通过快照发现 imageOnLoad 已触发,但 pending 队列仍保留很多 pendingWrap 对象,导致内存泄漏。
imageOnLoad
pendingWrap
#339 与这个issue相似,createOrUpdateImage 函数在获取已存在 image时,是通过判断图片元素是否有尺寸来决定要不要添加到 pending 队列。
createOrUpdateImage
image
zrender/src/graphic/helper/image.ts
Line 65 in 379f91f
Line 104 in 379f91f
width
height
或许可以添加一个图片是否已完成加载(无论成功与否)的标记,通过该标记判断是否需要添加到pending队列?
The content you are editing has changed. Please copy your edits and refresh the page.
The text was updated successfully, but these errors were encountered:
为了能够更好地确认问题,能麻烦提供一个例子方便复现吗?
Sorry, something went wrong.
No branches or pull requests
我在做我们产品的内存快照分析时发现了这个问题:
通过快照发现
imageOnLoad
已触发,但 pending 队列仍保留很多pendingWrap
对象,导致内存泄漏。#339 与这个issue相似,
createOrUpdateImage
函数在获取已存在image
时,是通过判断图片元素是否有尺寸来决定要不要添加到 pending 队列。zrender/src/graphic/helper/image.ts
Line 65 in 379f91f
zrender/src/graphic/helper/image.ts
Line 104 in 379f91f
但如果图片已加载失败(不会再触发
imageOnLoad
回调),图片的width
和height
都会为0,则后续的调用将导致这个图片的pending队列一直增加,进而产生内存泄漏。或许可以添加一个图片是否已完成加载(无论成功与否)的标记,通过该标记判断是否需要添加到pending队列?
Tasks
The text was updated successfully, but these errors were encountered: