Save Sones and configuration on stopping.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 12 Sep 2012 05:48:43 +0000 (07:48 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 12 Sep 2012 05:50:41 +0000 (07:50 +0200)
src/main/java/net/pterodactylus/sone/core/Core.java

index 14e9f89..0ce144a 100644 (file)
@@ -1966,11 +1966,13 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
        @Override
        public void serviceStop() {
                synchronized (localSones) {
-                       for (SoneInserter soneInserter : soneInserters.values()) {
-                               soneInserter.removeSoneInsertListener(this);
-                               soneInserter.stop();
+                       for (Entry<Sone, SoneInserter> soneInserter : soneInserters.entrySet()) {
+                               soneInserter.getValue().removeSoneInsertListener(this);
+                               soneInserter.getValue().stop();
+                               saveSone(soneInserter.getKey());
                        }
                }
+               saveConfiguration();
                webOfTrustUpdater.stop();
                updateChecker.stop();
                updateChecker.removeUpdateListener(this);