Skip to content

Commit

Permalink
Added statement to catch any and all problems when shutting down...
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Luc Paour committed Nov 22, 2002
1 parent ba7a65a commit 8329ea2
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions com/gallery/GalleryRemote/MainFrame.java
Expand Up @@ -189,34 +189,36 @@ public void initComponents()
*@param e Event
*/
void thisWindowClosing( java.awt.event.WindowEvent e ) {
PropertiesFile p = GalleryRemote.getInstance().properties;
for (int i = 0; i < galleries.getSize(); i++) {
Gallery g = (Gallery) galleries.getElementAt(i);
p.setProperty( "url." + i, g.getUrlString() );

if (g.getUsername() != null) {
p.setProperty( "username." + i, g.getUsername() );
}

if (p.getBooleanProperty("savePasswords") && g.getPassword() != null) {
p.setBase64Property( "password." + i, g.getPassword() );
try {
PropertiesFile p = GalleryRemote.getInstance().properties;
for (int i = 0; i < galleries.getSize(); i++) {
Gallery g = (Gallery) galleries.getElementAt(i);
p.setProperty( "url." + i, g.getUrlString() );

if (g.getUsername() != null) {
p.setProperty( "username." + i, g.getUsername() );
}

if (p.getBooleanProperty("savePasswords") && g.getPassword() != null) {
p.setBase64Property( "password." + i, g.getPassword() );
}
}

p.setMainBounds( getBounds() );
p.setPreviewBounds( previewFrame.getBounds() );
p.setIntProperty( "inspectorDividerLocation", inspectorDivider.getDividerLocation() );

p.write();

setVisible( false );
dispose();

ImageUtils.purgeTemp();
} catch (Throwable t) {
Log.log(Log.ERROR, MODULE, "Error while closing: " + t);
}

p.setMainBounds( getBounds() );
p.setPreviewBounds( previewFrame.getBounds() );
p.setIntProperty( "inspectorDividerLocation", inspectorDivider.getDividerLocation() );

p.write();

setVisible( false );
dispose();

ImageUtils.purgeTemp();

Log.log(Log.INFO, "Shutting log down");
Log.log(Log.INFO, MODULE, "Shutting log down");
Log.shutdown();

System.exit( 0 );
}

Expand Down

0 comments on commit 8329ea2

Please sign in to comment.