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

fix: Keyboard event memory leak #469

Merged
merged 2 commits into from
Jan 13, 2024
Merged

Conversation

qiongshusheng
Copy link
Contributor

@qiongshusheng qiongshusheng commented Jan 12, 2024

问题:当绑定快捷键时会给元素添加keyup和keydown的事件,该事件一直没有被移除,即使元素上的快捷键都unbind了,也不会清除keyup和keydown事件,导致内存泄漏。
解决方案:在unbind时判断unbind的元素上是否还有快捷键,如果没有快捷键就移除该元素上的keyup和keydown事件

解决 #90 提到的内存泄漏问题
解决 #115 提到的在vue中使用引起的内存泄漏问题

@jaywcjlove jaywcjlove merged commit 816d76d into jaywcjlove:master Jan 13, 2024
github-actions bot pushed a commit that referenced this pull request Jan 13, 2024
* fix: Keyboard event memory leak

* fix: add dist 816d76d
jaywcjlove added a commit that referenced this pull request Jan 13, 2024
github-actions bot pushed a commit that referenced this pull request Jan 13, 2024
@jaywcjlove
Copy link
Owner

@jaywcjlove thx!

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.

2 participants