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

修复不再使用的MutationObserver引起的内存泄漏问题 #581

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LeoJiaXin
Copy link

Description

MutationObserver当前会被劫持,每个MutationObserver实例都会被缓存到observerSet中

改成:observe的时候缓存到observerSet,disconnect的时候删除实例

Related Issue

暂无

Motivation and Context

MutationObserver实例较多的时候,对于长时间使用的Web应用来说,内存会不断上涨,最终导致浏览器崩溃

How Has This Been Tested

打了js heap验证,在我们的项目目前是可以正常运行的

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


刘嘉鑫 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@vercel
Copy link

vercel bot commented Dec 8, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
garfish ✅ Ready (Inspect) Visit Preview Dec 8, 2022 at 3:03AM (UTC)

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

Successfully merging this pull request may close these issues.

None yet

2 participants