mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 09:21:49 -05:00
Make sure we do exit: catch exceptions before System.exit
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@589 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
e5c1fcd807
commit
32bc5eeb02
@ -188,6 +188,7 @@ public class AwtGatewayTray implements DavGatewayTrayInterface {
|
||||
// create an action exitListener to listen for exit action executed on the tray icon
|
||||
ActionListener exitListener = new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
DavGateway.stop();
|
||||
SystemTray.getSystemTray().remove(trayIcon);
|
||||
|
||||
@ -197,6 +198,9 @@ public class AwtGatewayTray implements DavGatewayTrayInterface {
|
||||
if (logBrokerMonitor != null) {
|
||||
logBrokerMonitor.dispose();
|
||||
}
|
||||
} catch (Exception exc) {
|
||||
DavGatewayTray.error(exc);
|
||||
}
|
||||
// make sure we do exit
|
||||
System.exit(0);
|
||||
}
|
||||
|
@ -177,6 +177,7 @@ public class FrameGatewayTray implements DavGatewayTrayInterface {
|
||||
// create an action exitListener to listen for exit action executed on the tray icon
|
||||
ActionListener exitListener = new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
DavGateway.stop();
|
||||
// dispose frames
|
||||
settingsFrame.dispose();
|
||||
@ -184,6 +185,9 @@ public class FrameGatewayTray implements DavGatewayTrayInterface {
|
||||
if (logBrokerMonitor != null) {
|
||||
logBrokerMonitor.dispose();
|
||||
}
|
||||
} catch (Exception exc) {
|
||||
DavGatewayTray.error(exc);
|
||||
}
|
||||
// make sure we do exit
|
||||
System.exit(0);
|
||||
}
|
||||
|
@ -136,6 +136,7 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
|
||||
new Thread("SWT") {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
display = new Display();
|
||||
shell = new Shell(display);
|
||||
|
||||
@ -282,10 +283,13 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
|
||||
if (logBrokerMonitor != null) {
|
||||
logBrokerMonitor.dispose();
|
||||
}
|
||||
}
|
||||
} catch (Exception exc) {
|
||||
DavGatewayTray.error(exc);
|
||||
}
|
||||
// make sure we do exit
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
while (true) {
|
||||
// wait for SWT init
|
||||
|
Loading…
x
Reference in New Issue
Block a user