-
Notifications
You must be signed in to change notification settings - Fork 1.8k
更改动画占用内存,持续不放的问题 #4357
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
base: master
Are you sure you want to change the base?
更改动画占用内存,持续不放的问题 #4357
Conversation
💖 Thanks for opening this pull request! 💖 Please follow the contributing guidelines. And we use semantic commit messages to streamline the release process. Examples of commit messages with semantic prefixes:
Things that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4357 +/- ##
=======================================
Coverage 10.29% 10.29%
=======================================
Files 180 180
Lines 10620 10620
Branches 2590 2590
=======================================
Hits 1093 1093
Misses 9438 9438
Partials 89 89
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
job.cb() | ||
} else { | ||
const index = this.findInsertionIndex(job) | ||
if (index >= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里为什么要重复判断呀?index > 0 已经说明这个 job 存在呀。
@LuckyTaoTao 抽空看看 code review 的内容。 |
确实存在这个问题,当多个 animation 同时执行时,queueJob 的速度比 flushJob 的速度快,就存在 job 堆积,目前是在动画 complete 的时候手动调用 queue.clearJobs 来解决的 |
Description
const animations = (edge, path, duration) => { let timeoutId; return new Promise((resolve) => { edge.transition(path, 1, { duration: duration, timing: Timing.linear, delay: 0, complete: ({ cell, path }) => { if (animationRunning.value) { resolve(); cell.updateAttrs( { arrow1: { atConnectionRatio: 0 }, }, { silent: true } ); timeoutId = setTimeout(() => animations(cell, path, duration), 500); } else { resolve(); // 停止动画循环时,也要正常完成Promise } }, }); if (timeoutId) { clearTimeout(timeoutId); } }); };
this.queue在动画循环下,会持续增加,导致百万级别不释放,最后内存不释放
Motivation and Context
Types of changes
Self Check before Merge