Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixed memory leak in case of NSMenuItem. #154

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

sonsongithub
Copy link
Contributor

NSMenuItem has been leaked after calling setShortcuts and KeyboardShortcuts.removeAllHandlers.

The leak is caused by a callback function registered in the notification center that captures an NSMenuItem.
I added the code to remove NSMenuItem from notification center explicitly in case of calling setShortcut(nil) to get around this issue.

@sindresorhus sindresorhus merged commit c252200 into sindresorhus:main Nov 27, 2023
1 check passed
@sindresorhus
Copy link
Owner

Thanks :)

@sonsongithub sonsongithub deleted the fix-menuitem-leak branch November 28, 2023 02:18
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants