Index: src/org/openstreetmap/josm/actions/SessionSaveAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/SessionSaveAction.java	(revision 18940)
+++ src/org/openstreetmap/josm/actions/SessionSaveAction.java	(working copy)
@@ -155,6 +155,14 @@
      * @throws UserCancelException when the user has cancelled the save process
      */
     public boolean saveSession(boolean saveAs, boolean forceSaveAll) throws UserCancelException {
+        try {
+            return saveSessionImpl(saveAs, forceSaveAll);
+        } finally {
+            cleanup();
+        }
+    }
+
+    private boolean saveSessionImpl(boolean saveAs, boolean forceSaveAll) throws UserCancelException {
         if (!isEnabled()) {
             return false;
         }
@@ -368,9 +376,9 @@
         }
 
         /**
-         * Initializes action.
+         * Initializes some action fields.
          */
-        public final void initialize() {
+        private void initialize() {
             layers = new ArrayList<>(getLayerManager().getLayers());
             exporters = new HashMap<>();
             dependencies = new MultiMap<>();
@@ -612,4 +620,10 @@
         return false;
     }
 
+    protected void cleanup() {
+        layers = null;
+        exporters = null;
+        dependencies = null;
+    }
+
 }
