Fixes a recently-introduced bug which could take advantage of a race condition and display twice the dialog notifying that the application will not exit when closing the main frame.

cusax-fix
Lyubomir Marinov 17 years ago
parent 916e9d1709
commit d09fdc8414

@ -114,8 +114,8 @@ public MainFrame()
menu = new MainMenu(this);
/*
* Before closing the application window saves the current size and
* position through the ConfigurationService.
* If the application is configured to quit when this frame is closed,
* do so.
*/
this.addWindowListener(new WindowAdapter()
{
@ -123,11 +123,6 @@ public void windowClosed(WindowEvent event)
{
MainFrame.this.windowClosed(event);
}
public void windowClosing(WindowEvent event)
{
MainFrame.this.windowClosing(event);
}
});
addComponentListener(new ComponentAdapter()
@ -1417,11 +1412,16 @@ protected void windowClosed(WindowEvent event)
}
}
/**
* @param event Currently not used
/*
* Overrides SIPCommFrame#windowClosing(WindowEvent). Reflects the closed
* state of this MainFrame in the configuration in order to make it
* accessible to interested parties, displays the warning that the
* application will not quit.
*/
protected void windowClosing(WindowEvent event)
{
super.windowClosing(event);
if (!GuiActivator.getUIService().getExitOnMainWindowClose())
{
SwingUtilities.invokeLater(new Runnable()

Loading…
Cancel
Save