Always shutdown the logger.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 27 Oct 2010 16:34:02 +0000 (18:34 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 27 Oct 2010 16:34:02 +0000 (18:34 +0200)
src/main/java/net/pterodactylus/sone/main/SonePlugin.java

index 810fef1..50f17a1 100644 (file)
@@ -167,21 +167,24 @@ public class SonePlugin implements FredPlugin, FredPluginL10n, FredPluginBaseL10
         */
        @Override
        public void terminate() {
         */
        @Override
        public void terminate() {
-               /* stop the web interface. */
-               webInterface.stop();
+               try {
+                       /* stop the web interface. */
+                       webInterface.stop();
 
 
-               /* stop the core. */
-               core.stop();
+                       /* stop the core. */
+                       core.stop();
 
 
-               /* TODO wait for core to stop? */
-               try {
-                       pluginRespirator.putStore(pluginStore);
-               } catch (DatabaseDisabledException dde1) {
-                       logger.log(Level.WARNING, "Could not store plugin store, database is disabled.", dde1);
-               }
+                       /* TODO wait for core to stop? */
+                       try {
+                               pluginRespirator.putStore(pluginStore);
+                       } catch (DatabaseDisabledException dde1) {
+                               logger.log(Level.WARNING, "Could not store plugin store, database is disabled.", dde1);
+                       }
 
 
-               /* shutdown logger. */
-               Logging.shutdown();
+               } finally {
+                       /* shutdown logger. */
+                       Logging.shutdown();
+               }
        }
 
        //
        }
 
        //