Ignore:
Timestamp:
2020-10-14T15:51:24+02:00 (4 years ago)
Author:
GerdP
Message:

see #19885: memory leak with "temporary" objects in validator and actions

  • use ChangeNodesCommand

Simplifies code and avoids another memory leak

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java

    r17188 r17200  
    2323
    2424import org.openstreetmap.josm.actions.corrector.ReverseWayTagCorrector;
    25 import org.openstreetmap.josm.command.ChangeCommand;
     25import org.openstreetmap.josm.command.ChangeNodesCommand;
    2626import org.openstreetmap.josm.command.Command;
    2727import org.openstreetmap.josm.command.DeleteCommand;
     
    186186        //
    187187        Way targetWay = getTargetWay(ways);
    188         Way modifiedTargetWay = new Way(targetWay);
    189         modifiedTargetWay.setNodes(path);
    190188
    191189        final List<Command> resolution;
     
    203201        deletedWays.remove(targetWay);
    204202
    205         cmds.add(new ChangeCommand(dataSets.get(0), targetWay, modifiedTargetWay));
     203        cmds.add(new ChangeNodesCommand(dataSets.get(0), targetWay, path));
    206204        cmds.addAll(reverseWayTagCommands);
    207205        cmds.addAll(resolution);
Note: See TracChangeset for help on using the changeset viewer.