Index: trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- trunk/src/org/openstreetmap/josm/Main.java	(revision 8408)
+++ trunk/src/org/openstreetmap/josm/Main.java	(revision 8412)
@@ -1081,5 +1081,6 @@
 
     /**
-     * Closes JOSM and optionally terminates the Java Virtual Machine (JVM). If there are some unsaved data layers, asks first for user confirmation.
+     * Closes JOSM and optionally terminates the Java Virtual Machine (JVM).
+     * If there are some unsaved data layers, asks first for user confirmation.
      * @param exit If {@code true}, the JVM is terminated by running {@link System#exit} with a given return code.
      * @param exitCode The return code
@@ -1088,6 +1089,8 @@
      */
     public static boolean exitJosm(boolean exit, int exitCode) {
-        JCSCacheManager.shutdown();
         if (Main.saveUnsavedModifications()) {
+            worker.shutdown();
+            ImageProvider.shutdown(false);
+            JCSCacheManager.shutdown();
             geometry.remember("gui.geometry");
             if (map != null) {
@@ -1102,4 +1105,7 @@
                 }
             }
+            worker.shutdownNow();
+            ImageProvider.shutdown(true);
+
             if (exit) {
                 System.exit(exitCode);
Index: trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java	(revision 8408)
+++ trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java	(revision 8412)
@@ -434,7 +434,7 @@
     protected class SaveAndUploadTask implements Runnable {
 
-        private SaveLayersModel model;
-        private ProgressMonitor monitor;
-        private ExecutorService worker;
+        private final SaveLayersModel model;
+        private final ProgressMonitor monitor;
+        private final ExecutorService worker;
         private boolean canceled;
         private Future<?> currentFuture;
@@ -592,4 +592,5 @@
                 }
             });
+            worker.shutdownNow();
         }
 
@@ -598,4 +599,5 @@
                 currentTask.cancel();
             }
+            worker.shutdown();
             canceled = true;
         }
Index: trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 8408)
+++ trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 8412)
@@ -1612,7 +1612,7 @@
      * @return The same image as {@code bi} where all pixels of the given color are transparent.
      * This resulting image has also the special property {@link #PROP_TRANSPARENCY_FORCED} set to {@code color}
-     * @since 7132
      * @see BufferedImage#getProperty
      * @see #isTransparencyForced
+     * @since 7132
      */
     public static BufferedImage makeImageTransparent(BufferedImage bi, Color color) {
@@ -1653,6 +1653,6 @@
      * @param bi The {@code BufferedImage} to test
      * @return {@code true} if the transparency of {@code bi} has been enforced by a previous call to {@code makeImageTransparent}.
+     * @see #makeImageTransparent
      * @since 7132
-     * @see #makeImageTransparent
      */
     public static boolean isTransparencyForced(BufferedImage bi) {
@@ -1664,9 +1664,23 @@
      * @param bi The {@code BufferedImage} to test
      * @return {@code true} if {@code bi} has a transparent color determined by a previous call to {@code read}.
+     * @see #read
      * @since 7132
-     * @see #read
      */
     public static boolean hasTransparentColor(BufferedImage bi) {
         return bi != null && !bi.getProperty(PROP_TRANSPARENCY_COLOR).equals(Image.UndefinedProperty);
     }
+
+    /**
+     * Shutdown background image fetcher.
+     * @param now if {@code true}, attempts to stop all actively executing tasks, halts the processing of waiting tasks.
+     * if {@code false}, initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted
+     * @since 8412
+     */
+    public static void shutdown(boolean now) {
+        if (now) {
+            IMAGE_FETCHER.shutdownNow();
+        } else {
+            IMAGE_FETCHER.shutdown();
+        }
+    }
 }
