Ciantic / trayicon-rs

Tray Icon Rust
MIT License
53 stars 17 forks source link

Is there a function to remove ICON at the exit of the program? #2

Closed TopsDesk closed 5 months ago

TopsDesk commented 3 years ago

Is there a function to remove ICON at the exit of the program? Somehow, I could not see a function call to TrayIcon that removes the ICON from System Tray.

Ciantic commented 3 years ago

Last time I tested it removes it automatically if you use these lines:

https://github.com/Ciantic/trayicon-rs/blob/df3e276bc52bee844ef0ba7fa7783c7d790c0cf3/examples/winit/src/main.rs#L72-L76

Notice, that the icon is cleaned when it's dropped. So when you move it inside the loop it's dropped gracefully.

Otherwise there is not graceful exit.