-
Notifications
You must be signed in to change notification settings - Fork 4.3k
fix(cli): old setInterval remains and is not cleared in garbage collection #32985
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
Changes from 1 commit
2a31e2b
19ae427
f7726d9
fa26047
d0d410f
279f5a9
70c7b85
06322de
e2ae3ba
9a7daea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,13 @@ | |
| } | ||
|
|
||
| public start() { | ||
| // If there is already a running setInterval, clear it first. | ||
| // This is because if this.setInterval is reassigned to another setInterval, | ||
| // the original setInterval remains and can no longer be cleared. | ||
| if (this.setInterval) { | ||
| clearInterval(this.setInterval); | ||
| } | ||
|
|
||
|
||
| this.setInterval = setInterval(() => { | ||
| if (!this.isPaused) { | ||
| this.print(); | ||
|
|
||
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.
This seems like the actual fix!