-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add support for removing a menu item #34
Conversation
79fa785
to
5196a4f
Compare
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.
Nice addition, thanks.
I think some code is needed for unix as well?
I'll have to give the Unix code a further look. Quick glance says pruning the button ID from a slice and triggering a refresh. Also, I did notice another memory leak I cannot quite figure out... Seems to be related to the Icon setting code on Darwin specifically. If I use a test harness to delete/create a new MenuItem every few seconds, after a few hours the memory usage multiplies exponentially. pprof nor Datadog show anything. If I remove SetIcon from the loop, the memory does not balloon. My thought is something is not freeing up transient resources, probably something in the cast from CGO -> NSData -> NSImage -> NSMenuItem.image. |
Thanks, do post here if you need more assistance with the unix code. With regards to icon memory leak, I think that also was reported in our usage in the toolkit at fyne-io/fyne#3463, so you're not the only one to see it. The image data is obviously not being cleaned up in the C code. |
5196a4f
to
7f28b0f
Compare
Should all be resolved now. Tested the tray on Kali, that dbus system is pretty interesting! |
Signed-off-by: Brian Dwyer <[email protected]>
Signed-off-by: Brian Dwyer <[email protected]>
7446191
to
31f066d
Compare
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.
Nice one thanks!
Resolves #33 and fyne-io/fyne#3463