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

feat: add handler method on menu item builders #9380

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

amrbashir
Copy link
Member

closes #9060

@amrbashir amrbashir requested a review from a team as a code owner April 4, 2024 03:20
@amrbashir
Copy link
Member Author

This will leak the menu item and will never run the Drop implementation for it

@amrbashir amrbashir marked this pull request as draft April 4, 2024 03:32
@martpie
Copy link

martpie commented Sep 3, 2024

Any news on this? Do you need help to test? :]

@amrbashir
Copy link
Member Author

I haven't had time to work on this unfortunately, as this leaks the menu items and I haven't found a better design yet.

@dmgolembiowski
Copy link

I haven't had time to work on this unfortunately, as this leaks the menu items and I haven't found a better design yet.

Do you recall where you noticed the memory leak occurring?

@amrbashir
Copy link
Member Author

amrbashir commented Nov 12, 2024

The menu items are reference counted and it is expected to be either cloned by user or internally when added to a menu, both of which gives the user the ability to drop the item whenever feels like it.

However this PR implementation clones the item and moves it into a closure that is stored by tauri internals and so if the user drops all of his menu item instances, it is still kept around for the closure that is stored by tauri internals, hence the leak.

I am pretty sure it is not impossible, but I didn't have time to work on it lately.

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.

[feat] Menu event handler directly on MenuItemBuilder
3 participants