-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
更改动画占用内存,持续不放的问题 #4357
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4357 +/- ##
=======================================
Coverage 10.34% 10.34%
=======================================
Files 180 180
Lines 10582 10582
Branches 2580 2580
=======================================
Hits 1095 1095
Misses 9398 9398
Partials 89 89
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -12,7 +12,8 @@ export class JobQueue { | |||
} 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 存在呀。
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