Prevent multiple system tray icons

Added "synchronized" to SysTray.getInstance.

Also log launching of system tray icon.
This commit is contained in:
catbref 2019-07-12 09:41:31 +01:00
parent 964e0a02ca
commit b038e10ee7

View File

@ -39,6 +39,8 @@ public class SysTray {
if (!SystemTray.isSupported())
return;
LOGGER.info("Launching system tray icon");
this.popupMenu = createJPopupMenu();
// Build TrayIcon without AWT PopupMenu (which doesn't support Unicode)...
@ -170,7 +172,7 @@ public class SysTray {
}
}
public static SysTray getInstance() {
public static synchronized SysTray getInstance() {
if (instance == null)
instance = new SysTray();