diff --git a/src/java/davmail/ui/tray/SwtGatewayTray.java b/src/java/davmail/ui/tray/SwtGatewayTray.java index 787ee6c3..1e4a8909 100644 --- a/src/java/davmail/ui/tray/SwtGatewayTray.java +++ b/src/java/davmail/ui/tray/SwtGatewayTray.java @@ -322,7 +322,13 @@ public class SwtGatewayTray implements DavGatewayTrayInterface { if (image2 != null) { image2.dispose(); } - display.dispose(); + try { + if (!display.isDisposed()) { + display.dispose(); + } + } catch (Exception e) { + // already disposed + } // dispose AWT frames settingsFrame.dispose(); aboutFrame.dispose();