I've built an application that hides in the system tray via the SystemTray class. Works ok, but when I quit the program and start it again, it doesn't remove the icon from the tray before hovering it with the cursor. Doing this multiple times causes multiple icons to appear:
Is this a problem with my program or is it a Windows' bug?
I followed this guide to create the system tray icon.
When an application which created a tray icon is terminated, Windows doesn't remove the tray icon automatically. It only does so when the user hovers over it with the mouse and notices that the owning process doesn't exist anymore.
To make sure that the icon is removed immediately, you have to call systemTray.remove(yourIcon)
when your program quits.