Changeset 17378 in josm


Ignore:
Timestamp:
2020-11-30T16:22:13+01:00 (3 months ago)
Author:
GerdP
Message:

fix #17196 Undo/Redo may change data in inactive layer

  • fix case when there are two layers with changes and one layer is closed. The undo stack for the other layer disappeared.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java

    r17351 r17378  
    473473        if (dataSet == null)
    474474            return;
    475         if (InstanceHolder.map.remove(dataSet) != null) {
    476             redoCommands.clear();
    477             commands.clear();
    478             fireEvent(new CommandQueueCleanedEvent(this, dataSet));
    479             fireCommandsChanged();
     475        UndoRedoHandler old = InstanceHolder.map.remove(dataSet);
     476        if (old != null) {
     477            old.clean();
    480478        }
    481479    }
Note: See TracChangeset for help on using the changeset viewer.